task/3382: Harmonisera tabellnamn #6

Merged
ansv7779 merged 104 commits from task/3382 into develop 2024-11-12 13:33:44 +01:00
2 changed files with 6 additions and 6 deletions
Showing only changes of commit 9a8604d76a - Show all commits

View File

@ -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

Again less self describing column name. creator_id tells you it is the user who created the template rather than just a generic user_id. The referenced table/type is visible from the foreign key/class.

Again less self describing column name. `creator_id` tells you it is the user who created the template rather than just a generic `user_id`. The referenced table/type is visible from the foreign key/class.
private User creator;
//</editor-fold>

View File

@ -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