task/3382: Fix table user_profile_project_type and it's containing entity class UserProfile (no fix on project_type yet) - missed db-script.

This commit is contained in:
Tom Zhao 2024-07-03 13:23:11 +02:00
parent 7869f17ba3
commit cdaa57aefa

@ -735,6 +735,32 @@ alter table `user_profile_default_project_team_member_roles_filter`
on delete cascade on update cascade;
/* *********************************************************************************************** */
/* Table ProjectType and all tables which reference to ProjectType... */
-- fix table user_profile_ProjectType except foreign key to table project_type
alter table `user_profile_ProjectType` drop foreign key `FK_user_profile_project_type_user_profile`;
alter table `user_profile_ProjectType` drop foreign key `FK_76s8320kw3w7bxp6lw7pmawfh`;
alter table `user_profile_ProjectType` drop key `FK_2blea2vk0b5cvgxjo1fy4p2j0`;
rename table `user_profile_ProjectType` to `user_profile_project_type`;
alter table `user_profile_project_type` rename column `defaultProjectTypeFilter_id` to `project_type_id`;
alter table `user_profile_project_type`
add constraint fk_user_profile_project_type_user_profile_id
foreign key (user_profile_id) references user_profile(id)
on delete cascade on update cascade;
-- activate following later
/*
alter table `user_profile_project_type`
add constraint fk_user_profile_project_type_project_type_id
foreign key (project_type_id) references project_type(id)
on delete cascade on update cascade;
*/
/* the mess with ProjectType