Skip to content

Commit

Permalink
Fix UserMetrics and User cyclic dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgxvii committed Oct 20, 2023
1 parent 5ae08f2 commit 537ee48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class UserMetrics extends AuditModel implements Serializable {
@Column(name = "last_delivered")
private Instant lastDelivered;

@ToString.Exclude @NonNull @OneToOne private User user;
@ToString.Exclude @NonNull @OneToOne(mappedBy = "usermetrics") private User user;

public UserMetrics(Instant lastOpened, Instant lastDelivered) {
this.lastOpened = lastOpened;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
databaseChangeLog:
- changeSet:
id: 1697819541-01
author: pauline
changes:
- dropForeignKeyConstraint:
baseColumnNames: user_id
baseTableName: user_metrics
constraintName: FK65c9asnnjs3q0lktqj103mvcv
deferrable: false
initiallyDeferred: false
referencedColumnNames: id
referencedTableName: users
validate: true

0 comments on commit 537ee48

Please sign in to comment.