task/3382: Add back unique key to table idea and fix 'on delete set null' to peer_request and activity_template

This commit is contained in:
Tom Zhao 2024-11-06 11:52:59 +01:00
parent 0403726460
commit 081678fcac

@ -1040,7 +1040,7 @@ alter table `activity_template` rename column `checkListTemplate_id` to `checkli
alter table `activity_template`
add constraint fk_activity_template_checklist_template_id
foreign key (checklist_template_id) references checklist_template (id)
on delete cascade on update cascade;
on delete set null on update cascade;
-- table: ActivityPlanTemplate (at this stage, no any foreign key is referenced to ActivityPlanTemplate)
@ -1648,6 +1648,8 @@ alter table `idea` change `interests` `interests` longtext default null after `m
alter table `idea` rename column `creator_id` to `creator_user_id`;
alter table `idea` rename column `match_id` to `latest_match_id`;
alter table `idea` add constraint uk_idea_project_id unique(project_id);
alter table `idea`
add constraint fk_idea_creator_user_id
foreign key (creator_user_id) references user (id)
@ -1932,7 +1934,7 @@ alter table `peer_request` change `file_reference_id` `file_reference_id` bigint
alter table `peer_request`
add constraint fk_peer_request_checklist_template_id
foreign key (checklist_template_id) references checklist_template (id)
on delete cascade on update cascade;
on delete set null on update cascade;
alter table `peer_request`
add constraint fk_peer_request_file_reference_id