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

View File

@ -1,17 +1,27 @@
package se.su.dsv.scipro.report;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import jakarta.persistence.Basic;
import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OneToOne;
import jakarta.persistence.Table;
import se.su.dsv.scipro.finalseminar.FinalSeminarOpposition;
import se.su.dsv.scipro.project.Project;
import se.su.dsv.scipro.system.DomainObject;
import se.su.dsv.scipro.system.ProjectType;
import se.su.dsv.scipro.system.User;
import jakarta.persistence.*;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
@Entity
@Table(name = "grading_report_template")
public class GradingReportTemplate extends DomainObject {
@ -21,6 +31,7 @@ public class GradingReportTemplate extends DomainObject {
private Long id;
@OneToOne(optional = false)
@Column(name = "proejct_type_id")
private ProjectType projectType;
@OneToMany(mappedBy = "gradingReportTemplate", cascade = {CascadeType.ALL})

View File

@ -791,13 +791,29 @@ alter table `project_type_settings` rename column `maxOpponentsOnFinalSeminar` t
alter table `project_type_settings` rename column `minFinalSeminarActiveParticipation` to `min_final_seminar_active_participation`;
alter table `project_type_settings` rename column `minOpponentsOnFinalSeminar` to `min_opponents_on_final_seminar`;
alter table `project_type_settings` rename column `minimumOppositionsToBeGraded` to `min_oppositions_to_be_graded`;
alter table `project_type_settings` rename column `minimumActiveParticipationsToBeGraded` to `min_oppositions_to_be_graded`;
alter table `project_type_settings` rename column `minimumActiveParticipationsToBeGraded` to `min_active_participations_to_be_graded`;
alter table `project_type_settings` add constraint uk_project_type_settings_project_type_id unique(project_type_id);
-- fix table grading_report_template except foreign key to table project_type
alter table `grading_report_template` drop foreign key `FK_grading_report_template_projectType`;
alter table `grading_report_template` drop key `FK_qovbb9ql33oaxprfr01w7ss9u`;
alter table `grading_report_template` rename column `projectType_id` to `project_type_id`;
-- activate following later
/*
-- fix table ProjectType
-- add foreign key reference from grading_report_template to project_type
alter table `grading_report_template`
add constraint fk_grading_report_template_project_type_id
foreign key(project_type_id) references project_type(id)
on delete cascade on update cascade;
-- add foreign key reference from project_type_settings to project_type
alter table `project_type_settings`
add constraint fk_project_type_settings_project_type_id