task/3382: Rename 'user_id' to 'creator_user_id' for activity_plan_template

This commit is contained in:
Tom Zhao 2024-11-12 11:00:51 +01:00
parent c833426a69
commit 9a8604d76a
2 changed files with 6 additions and 6 deletions
core/src/main
java/se/su/dsv/scipro/activityplan
resources/db/migration

@ -39,7 +39,7 @@ public class ActivityPlanTemplate extends DomainObject {
private boolean isSysAdminTemplate = false;
@Basic
@Column(nullable=false)
@Column(name = "title", nullable = false)
private String title;
@Basic
@ -49,8 +49,8 @@ public class ActivityPlanTemplate extends DomainObject {
//</editor-fold>
//<editor-fold desc="JPA-mappings of foreign keys in this table (activity_plan_template) referencing other tables.">
@ManyToOne(optional=false)
@JoinColumn(name = "user_id")
@ManyToOne(optional = false)
@JoinColumn(name = "creator_user_id", referencedColumnName = "id")
private User creator;
//</editor-fold>

@ -1043,11 +1043,11 @@ alter table `ActivityPlanTemplate` drop key `FKACCF6522E44F4DBE`;
rename table `ActivityPlanTemplate` to `activity_plan_template`;
alter table `activity_plan_template` rename column `isSysAdminTemplate` to `is_sys_admin_template`;
alter table `activity_plan_template` rename column `creator_id` to `user_id`;
alter table `activity_plan_template` rename column `creator_id` to `creator_user_id`;
alter table `activity_plan_template`
add constraint fk_activity_plan_template_user_id
foreign key (user_id) references user (id)
add constraint fk_activity_plan_template_creator_user_id
foreign key (creator_user_id) references user (id)
on delete cascade on update cascade;
-- Add back all foreign key references to activity_plan_template