diff --git a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java index 318a7bf..4f8d43a 100644 --- a/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java +++ b/bot-context/src/main/java/dev/struchkov/bot/gitlab/context/domain/entity/MergeRequest.java @@ -117,6 +117,17 @@ public class MergeRequest { @Column(name = "is_reviewer") private boolean userReviewer; + @OneToMany( + fetch = FetchType.LAZY, + cascade = {CascadeType.PERSIST, CascadeType.MERGE} + ) + @JoinTable( + name = "merge_request_approvals", + joinColumns = @JoinColumn(name = "merge_request_id", referencedColumnName = "id"), + inverseJoinColumns = @JoinColumn(name = "person_id", referencedColumnName = "id") + ) + private List approvals = new ArrayList<>(); + @ElementCollection @CollectionTable(name = "merge_request_label", joinColumns = @JoinColumn(name = "merge_request_id")) @Column(name = "label") diff --git a/gitlab-app/src/main/resources/application.yml b/gitlab-app/src/main/resources/application.yml index 94cd7ef..4543a0b 100644 --- a/gitlab-app/src/main/resources/application.yml +++ b/gitlab-app/src/main/resources/application.yml @@ -8,7 +8,7 @@ spring: change-log: classpath:liquibase/changelog.xml jpa: show-sql: false - open-in-view: false +# open-in-view: false hibernate: ddl-auto: none properties: