hx_rel_learning_task_add_fk.sql 985 B

12345678910111213141516171819202122
  1. alter table hx_rel_learning_task_schedule_course
  2. add constraint `hx_rel_learning_task_schedule_course_uniq`
  3. unique (learning_task_id, schedule_id, course_id);
  4. alter table hx_rel_learning_task_schedule_course
  5. add foreign key (learning_task_id) references hx_learning_task(id),
  6. add foreign key (schedule_id) references hx_course_schedule(id),
  7. add foreign key (course_id) references kg_course(id);
  8. alter table hx_rel_learning_task_department_employee
  9. add constraint `hx_rel_learning_task_department_employee_uniq`
  10. unique (learning_task_id, department_id, employee_id);
  11. alter table hx_rel_learning_task_department_employee
  12. add foreign key (learning_task_id) references hx_learning_task(id),
  13. add foreign key (department_id) references hx_department(id),
  14. add foreign key (employee_id) references hx_employee(id);
  15. alter table hx_user_learning_task_custom
  16. add constraint hx_user_learning_task_custom_uniq
  17. unique (user_id, tenant_id, learning_task_id);