Bugfix:
LocationBasedServices/sumoc-backend/pipeline/head This commit looks good

1. /data/ is readonly on macOS -> changed to ./keys/
2. Changed Friendcode Annotation to unique
This commit is contained in:
2026-01-22 14:44:19 +01:00
parent 59a43be9ee
commit 4c1476944a
3 changed files with 13 additions and 6 deletions
@@ -38,7 +38,7 @@ public class User {
@Column(nullable = false)
private VisibilityPrivacy visibilityPrivacy;
@Column(nullable = false)
@Column(nullable = false, unique = true, length = 36)
private String friendCode;
@OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true)
@@ -86,6 +86,13 @@ public class User {
this.statsList = new StatsList(this);
}
@PrePersist
private void ensureFriendCode() {
if (this.friendCode == null) {
this.friendCode = UUID.randomUUID().toString();
}
}
public Long getId() {
return id;
}