task/3382: Harmonisera tabellnamn #6
@ -4,7 +4,7 @@ import jakarta.persistence.*;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "Program")
|
@Table(name = "program")
|
||||||
public class Program extends DomainObject {
|
public class Program extends DomainObject {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@ -12,13 +12,13 @@ public class Program extends DomainObject {
|
|||||||
@Column(name = "id")
|
@Column(name = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
@Column(name = "externalId")
|
@Column(name = "external_id")
|
||||||
private Integer externalId;
|
private Integer externalId;
|
||||||
|
|
||||||
@Column(name = "name")
|
@Column(name = "name_sv")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Column(name = "nameEn", nullable = true)
|
@Column(name = "name_en", nullable = true)
|
||||||
private String nameEn;
|
private String nameEn;
|
||||||
|
|
||||||
@Column(name = "code")
|
@Column(name = "code")
|
||||||
|
@ -489,13 +489,39 @@ alter table `general_system_settings` rename column `externalGradingURL` to `ext
|
|||||||
alter table `general_system_settings` rename column `finalSurveyAvailable` to `final_survey_available`;
|
alter table `general_system_settings` rename column `finalSurveyAvailable` to `final_survey_available`;
|
||||||
alter table `general_system_settings` rename column `activeProjectIdeaSupportMail` to `active_project_idea_support_mail`;
|
alter table `general_system_settings` rename column `activeProjectIdeaSupportMail` to `active_project_idea_support_mail`;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Step 5: table user and related tables.
|
||||||
|
*
|
||||||
|
* Table user is one of four fundamental tables (other three: project, file_reference, ProjectType). All four
|
||||||
|
* tables have many foreign keys referenced to them.
|
||||||
|
*
|
||||||
|
* Related tables of table user are the tables which have no relationship with other three fundamental tables. Their
|
||||||
|
* foreign key references end at table user.
|
||||||
|
*/
|
||||||
|
|
||||||
|
-- table Program and user_program
|
||||||
|
|
||||||
|
alter table `user_program` drop foreign key `user_program_program_id`;
|
||||||
|
alter table `user_program` drop key `user_program_program_id`;
|
||||||
|
|
||||||
|
alter table `user_program` drop foreign key `user_program_user_id`;
|
||||||
|
|
||||||
|
rename table `Program` to `program`;
|
||||||
|
|
||||||
|
alter table `program` rename column `externalId` to `external_id`;
|
||||||
|
alter table `program` rename column `name` to `name_sv`;
|
||||||
|
alter table `program` rename column `nameEn` to `name_en`;
|
||||||
|
|
||||||
|
alter table `user_program`
|
||||||
|
add constraint fk_user_program_program_id
|
||||||
|
foreign key (program_id)
|
||||||
|
references program(id)
|
||||||
|
on delete cascade
|
||||||
|
on update cascade;
|
||||||
|
|
||||||
|
alter table `user_program`
|
||||||
|
add constraint fk_user_program_user_id
|
||||||
|
foreign key (user_id)
|
||||||
|
references user(id)
|
||||||
|
on delete cascade
|
||||||
|
on update cascade;
|
Loading…
x
Reference in New Issue
Block a user