diff --git a/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql b/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql index 77136f8df6..ef809dd844 100644 --- a/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql +++ b/core/src/main/resources/db/migration/V390__harmonize_table_attribute_name.sql @@ -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