Skip to content

Commit c78e317

Browse files
committed
refactor: User 엔티티 필드 수정
1 parent 080d2ab commit c78e317

File tree

1 file changed

+8
-18
lines changed
  • src/main/java/com/back/domain/user/entity

1 file changed

+8
-18
lines changed

src/main/java/com/back/domain/user/entity/User.java

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
package com.back.domain.user.entity;
22

33
import jakarta.persistence.*;
4-
import jakarta.validation.constraints.Email;
5-
import jakarta.validation.constraints.NotBlank;
64
import lombok.*;
75

86
import java.time.LocalDateTime;
97

108
@Entity
11-
@Table(
12-
name = "users", // DB 테이블 이름: User 대신 users 권장 (예약어 충돌 방지)
13-
indexes = {
14-
@Index(name = "ux_users_email", columnList = "email", unique = true)
15-
}
16-
)
9+
@Table(name = "users") // 예약어 충돌 방지를 위해 "users" 권장
1710
@Getter
1811
@Setter
1912
@NoArgsConstructor
@@ -25,18 +18,15 @@ public class User {
2518
@GeneratedValue(strategy = GenerationType.IDENTITY)
2619
private Long id;
2720

28-
@NotBlank
29-
@Email
30-
@Column(nullable = false, unique = true)
31-
private String email; // 유저 소셜 이메일 (OAuth2 로그인 시 저장)
21+
// OAuth 동의 범위에 따라 이메일이 없을 수 있어 nullable
22+
// 여러 provider에서 동일 이메일이 올 수 있으므로 unique 하지 않아도 됨
23+
@Column(length = 100)
24+
private String email;
3225

33-
@NotBlank
34-
@Column(nullable = false, unique = true)
35-
private String nickname; // 유저 닉네임
26+
@Column(nullable = false, unique = true, length = 50)
27+
private String nickname; // 고유 닉네임
3628

37-
private String profileImgUrl; // 프로필 이미지 URL
38-
39-
private Double abvDegree; // 온도(회원 등급)
29+
private Double abvDegree; // 알콜도수(회원 등급)
4030

4131
private LocalDateTime createdAt; // 생성 날짜
4232

0 commit comments

Comments
 (0)