Skip to content

Commit 92a8b10

Browse files
author
yuhojae
committed
refactor : 가상친구 테이블 컬럼 null허용 변경
1 parent 13489e2 commit 92a8b10

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

api/src/main/java/com/mbtips/domain/virtualfriend/request/VirtualFriendRequest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.mbtips.domain.virtualfriend.enums.Gender;
66
import com.mbtips.user.entity.UserEntity;
77
import com.mbtips.virtualfriend.entity.VirtualFriendEntity;
8+
import jakarta.persistence.Column;
89
import jakarta.validation.constraints.Max;
910
import jakarta.validation.constraints.Min;
1011
import jakarta.validation.constraints.NotBlank;
@@ -17,6 +18,7 @@
1718
@JsonIgnoreProperties(ignoreUnknown = true)
1819
public record VirtualFriendRequest(
1920

21+
@Column(nullable = false)
2022
String friendName,
2123

2224
int age,

repository/src/main/java/com/mbtips/virtualfriend/entity/VirtualFriendEntity.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,20 @@ public class VirtualFriendEntity {
2929
@Column(nullable = false)
3030
private String mbti;
3131

32-
@Column(length = 20, nullable = false)
32+
@Column(length = 20, nullable = true)
3333
private String virtualFriendName;
3434

35-
@Column(nullable = false)
35+
@Column(nullable = true)
3636
private int virtualFriendAge;
3737

3838
@Enumerated(EnumType.STRING)
39-
@Column(length = 10, nullable = false)
39+
@Column(length = 10, nullable = true)
4040
private Gender virtualFriendSex;
4141

42-
@Column(length = 30, nullable = false)
42+
@Column(length = 30, nullable = true)
4343
private String friendType;
4444

45-
@Column(length = 30, nullable = false)
45+
@Column(length = 30, nullable = true)
4646
private String job;
4747

4848
@Column(length = 100, nullable = true)

repository/src/main/resources/prod/application-repository.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ spring:
99
show-sql: true
1010
database-platform: org.hibernate.dialect.MySQL8Dialect
1111
hibernate:
12-
ddl-auto: none #테이블 생성
12+
ddl-auto: create #테이블 생성
1313
properties:
1414
hibernate:
1515
format_sql: true

0 commit comments

Comments
 (0)