Skip to content

Commit

Permalink
fix : User 엔티티에서 Email 유니크키 -> Email, Provider 다중컬럼 유니크키로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
LHS-11 committed Feb 13, 2024
1 parent 89981f2 commit dd4c6f6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/com/cmc/zenefitserver/domain/user/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
@ToString
@Getter
@Entity
@Table(name = "user")
@Table(name = "user", uniqueConstraints = {
@UniqueConstraint(
name = "EMAIL_PROVIDER_UNIQUE",
columnNames = {"email", "provider"}
)
})
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@SequenceGenerator(
name = "USER_SEQ_GENERATOR",
Expand All @@ -33,7 +38,7 @@ public class User extends BaseEntity {
@GeneratedValue(strategy = GenerationType.SEQUENCE)
private Long userId;

@Column(name = "email", unique = true)
@Column(name = "email")
private String email;

@Column(name = "nickname", unique = true)
Expand All @@ -53,7 +58,7 @@ public class User extends BaseEntity {
private EducationType educationType; // 학력 요건 내용

@ElementCollection
@CollectionTable(name = "user_jobs", joinColumns = @JoinColumn(name = "user_id",referencedColumnName = "user_id"))
@CollectionTable(name = "user_jobs", joinColumns = @JoinColumn(name = "user_id", referencedColumnName = "user_id"))
@Enumerated(EnumType.STRING)
private Set<JobType> jobs = new HashSet<>();

Expand Down

0 comments on commit dd4c6f6

Please sign in to comment.