1. /data/ is readonly on macOS -> changed to ./keys/ 2. Changed Friendcode Annotation to unique
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user