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 4 additions and 4 deletions
Showing only changes of commit e36018f927 - Show all commits

View File

@ -95,7 +95,7 @@ public class FinalSeminar extends LazyDeletableDomainObject {
* to delete the document
*/
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "file_reference_id", referencedColumnName = "id")
@JoinColumn(name = "document_file_reference_id", referencedColumnName = "id")
tozh4728 marked this conversation as resolved Outdated

Less self describing column name. document_reference_id tells you something extra rather than just a generic file_reference_id. The referenced table/type is visible from the foreign key/class. Each seminar also has multiple documents related to it so a better name is useful. Especially since the column document_upload_date references some "document" but there is no document file column.

Less self describing column name. `document_reference_id` tells you something extra rather than just a generic `file_reference_id`. The referenced table/type is visible from the foreign key/class. Each seminar also has multiple documents related to it so a better name is useful. Especially since the column `document_upload_date` references some "document" but there is no document file column.
private FileReference document;
@OneToOne(optional = false)

View File

@ -2116,15 +2116,15 @@ alter table `final_seminar` change `creationReason` `creation_reason` mediumtext
alter table `final_seminar` change `manualParticipants` `manual_participants` tinyint(1) not null default 0 after `creation_reason`;
alter table `final_seminar` change `project_id` `project_id` bigint(20) not null after `document_reference_id`;
alter table `final_seminar` rename column `document_reference_id` to `file_reference_id`;
alter table `final_seminar` rename column `document_reference_id` to `document_file_reference_id`;
alter table `final_seminar` add constraint uk_final_seminar_project_id unique(project_id);
create index idx_final_seminar_deleted on final_seminar (deleted);
alter table `final_seminar`
add constraint fk_final_seminar_file_reference_id
foreign key (file_reference_id) references file_reference (id)
add constraint fk_final_seminar_document_file_reference_id
foreign key (document_file_reference_id) references file_reference (id)
on delete cascade on update cascade;
alter table `final_seminar`