task/3382: Harmonisera tabellnamn #6
@ -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")
|
||||
tozh4728 marked this conversation as resolved
Outdated
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user
Again less self describing column name.
creator_id
tells you it is the user who created the template rather than just a genericuser_id
. The referenced table/type is visible from the foreign key/class.