Skip to content

Commit

Permalink
email is optional, fix entity constraints
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanlermitage committed Nov 21, 2023
1 parent 72a1cb2 commit fbebcca
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/main/java/manon/document/user/UserEntity.java
Expand Up @@ -94,9 +94,9 @@ public class UserEntity implements Serializable {
@Column(length = NICKNAME_MAX_LENGTH)
private String nickname;

/** Email, mandatory. */
/** Email. */
@Size(max = EMAIL_MAX_LENGTH, message = EMAIL_SIZE_ERRMSG)
@Column(nullable = false, length = EMAIL_MAX_LENGTH, unique = true)
@Column(length = EMAIL_MAX_LENGTH)
private String email;

@OneToMany(fetch = FetchType.LAZY, mappedBy = "user")
Expand Down
Expand Up @@ -75,8 +75,6 @@ create table user_stats
nb_users bigint not null,
primary key (id)
);
alter table user_
add constraint UK_ob8kqyqqgmefl0aco34akdtpe unique (email);
alter table user_
add constraint UK_sb8bbouer5wak8vyiiy4pf2bx unique (username);
alter table friendship
Expand Down
Expand Up @@ -10,15 +10,13 @@ create table user_
primary key,
authorities varchar(255) not null,
creation_date datetime(6) not null,
email varchar(256) null,
email varchar(255) null,
nickname varchar(24) null,
password varchar(256) not null,
registration_state varchar(255) not null,
update_date datetime(6) not null,
username varchar(24) not null,
version bigint not null,
constraint uk__user__email
unique (email),
constraint uk__user__username
unique (username)
);
Expand Down
Expand Up @@ -9,9 +9,7 @@ create table user_
primary key,
authorities varchar(255) not null,
creation_date timestamp not null,
email varchar(256)
constraint uk_ha67cvlhy4nk1prswl5gj1y0y
unique,
email varchar(255),
nickname varchar(24),
password varchar(256) not null,
registration_state varchar(255) not null,
Expand Down

0 comments on commit fbebcca

Please sign in to comment.