task/3382: Harmonisera tabellnamn #6

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

View File

@ -36,12 +36,12 @@ public class FinalThesis extends DomainObject {
private Long id;
@Basic
@Column(name = "english_title")
private String englishTitle;
@Column(name = "title_sv")
private String swedishTitle;
@Basic
@Column(name = "swedish_title")
private String swedishTitle;
@Column(name = "title_en")
private String englishTitle;
@Basic
@Column(name = "status")

View File

@ -18,9 +18,9 @@ import java.util.List;
import java.util.Objects;
@Entity
@DiscriminatorColumn(name = "type")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "grading_criterion")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type")
public abstract class GradingCriterion extends AbstractGradingCriterion {
public static final int FEEDBACK_LENGTH = 2000;

View File

@ -1535,7 +1535,7 @@ alter table `idea_keyword`
-- table: keyword
alter table `keyword` drop key `deleted_index`;
alter table `Keyword` drop key `deleted_index`;
rename table `Keyword` to `keyword`;
@ -1635,6 +1635,8 @@ alter table `idea` drop key `FK6E051897C1813915`;
alter table `idea` drop key `FK6E051897B9431B73`;
alter table `idea` drop key `FK6E051897E44F4DBE`;
alter table `idea` drop key `UK_only_one_idea_per_project`;
alter table `idea` change `published` `published` bit(1) not null default b'1' after `type`;
alter table `idea` change `cachedStatus` `cached_status` varchar(255) default null after `published`;
alter table `idea` change `inactive` `inactive` tinyint(1) not null default 0 after `cached_status`;
@ -2321,11 +2323,6 @@ alter table `GradingCriterion` change `gradingReport_id` `grading_report_id` big
rename table `GradingCriterion` to `grading_criterion`;
alter table `grading_criterion`
add constraint fk_grading_criterion_grading_report_id
foreign key (grading_report_id) references grading_report (id)
on delete cascade on update cascade;
-- add foreign key reference from grading_criterion_point to grading_criterion
alter table `grading_criterion_point`
@ -2690,9 +2687,9 @@ alter table FinalThesis drop key `FK_final_thesis_project`;
rename table FinalThesis to `final_thesis`;
alter table `final_thesis` change `englishTitle` `english_title` varchar(255) default null after `version`;
alter table `final_thesis` change `swedishTitle` `swedish_title` varchar(255) default null after `english_title`;
alter table `final_thesis` change `status` `status` varchar(32) not null after `swedish_title`;
alter table `final_thesis` change `swedishTitle` `title_sv` longtext default null after `version`;
alter table `final_thesis` change `englishTitle` `title_en` longtext default null after `title_sv`;
alter table `final_thesis` change `status` `status` varchar(32) not null after `title_en`;
alter table `final_thesis` change `dateApproved` `date_approved` date default null after `status`;
alter table `final_thesis` change `dateRejected` `date_rejected` date default null after `date_approved`;
alter table `final_thesis` change `rejection_comment` `rejection_comment` text default null after `date_rejected`;
@ -3230,47 +3227,3 @@ alter table `forum_notification`
add constraint fk_forum_notification_notification_data_id
foreign key (notification_data_id) references notification_data (id)
on delete cascade on update cascade;
-- todo: NotificationEvent, JPA-mapping
/* Useful SQL
>>> SQL query for FK-to:
select table_name, column_name, referenced_table_name, referenced_column_name
from information_schema.key_column_usage
where table_schema = 'tozh4728' and referenced_table_name = 'ProjectType';
>>> SQL query for FK-to count:
select referenced_table_name, count(*) as c
from information_schema.key_column_usage
where table_schema = 'tozh4728' and referenced_table_name is not null
group by referenced_table_name order by c desc;
>>> SQL Query for FK-from
select table_name, column_name, referenced_table_name, referenced_column_name
from information_schema.key_column_usage
where referenced_table_name is not null and table_name = 'user'
order by table_name;
>>> Show foreign keys
-- show foreign keys for a simple table
select table_name, column_name, constraint_name, referenced_table_name, referenced_column_name
from information_schema.key_column_usage
where table_schema = 'tozh4728' and
table_name = 'grade' and
constraint_name != 'PRIMARY';
-- show foreign keys for all tables
select table_name, column_name, constraint_name, referenced_table_name, referenced_column_name
from information_schema.key_column_usage
where table_schema = 'tozh4728' and
constraint_name != 'PRIMARY'
order by table_name collate utf8_nopad_bin, constraint_name collate utf8_nopad_bin;
>>> Show collation;
*/