task/3382: Harmonisera tabellnamn #6
@ -1,5 +1,6 @@
|
||||
package se.su.dsv.scipro.reviewing;
|
||||
|
||||
import jakarta.persistence.Basic;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
@ -19,22 +20,26 @@ public class ReviewerTarget extends DomainObject {
|
||||
@GeneratedValue(strategy = jakarta.persistence.GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
@JoinColumn(name = "user_id", nullable = false)
|
||||
private User reviewer;
|
||||
|
||||
@Basic
|
||||
tozh4728 marked this conversation as resolved
Outdated
|
||||
@Column(name = "year", nullable = false)
|
||||
private int year;
|
||||
|
||||
@Basic
|
||||
@Column(name = "spring", nullable = false)
|
||||
private int spring;
|
||||
|
||||
@Basic
|
||||
@Column(name = "autumn", nullable = false)
|
||||
private int autumn;
|
||||
|
||||
@Basic
|
||||
@Column(name = "note")
|
||||
private String note;
|
||||
|
||||
@ManyToOne(optional = false)
|
||||
@JoinColumn(name = "reviewer_user_id", referencedColumnName = "id", nullable = false)
|
||||
private User reviewer;
|
||||
|
||||
@Override
|
||||
public Long getId() {
|
||||
return id;
|
||||
|
@ -555,13 +555,13 @@ alter table `comment`
|
||||
alter table `reviewer_target` drop foreign key `FK_ReviewerTarget_ReviewerId`;
|
||||
alter table `reviewer_target` drop key `UK_ReviewerTarget_ReviewerId_Year`;
|
||||
|
||||
alter table `reviewer_target` rename column `reviewer_id` to `user_id`;
|
||||
alter table `reviewer_target` rename column `reviewer_id` to `reviewer_user_id`;
|
||||
|
||||
alter table `reviewer_target` add constraint uk_reviewer_target_user_id_year unique(user_id, year);
|
||||
alter table `reviewer_target` add constraint uk_reviewer_target_reviewer_user_id_year unique(reviewer_user_id, year);
|
||||
|
||||
alter table `reviewer_target`
|
||||
add constraint fk_reviewer_target_user_id
|
||||
foreign key (user_id) references user (id)
|
||||
add constraint fk_reviewer_target_reviewer_user_id
|
||||
foreign key (reviewer_user_id) references user (id)
|
||||
on delete cascade on update cascade;
|
||||
|
||||
-- table: notification_delivery_configuration
|
||||
|
Loading…
x
Reference in New Issue
Block a user
Loss of information in the column name, should be
reviewer_user_id
.