diff --git a/family/src/main/java/com/oing/domain/Family.java b/family/src/main/java/com/oing/domain/Family.java index f441a954..8147db16 100644 --- a/family/src/main/java/com/oing/domain/Family.java +++ b/family/src/main/java/com/oing/domain/Family.java @@ -19,7 +19,7 @@ public class Family extends BaseEntity { @Column(name = "family_id", columnDefinition = "CHAR(26)", nullable = false) private String id; - @Column(name = "family_name", columnDefinition = "CHAR(10)") + @Column(name = "family_name", columnDefinition = "CHAR(9)") private String familyName; @Column(name = "family_name_editor_id", columnDefinition = "CHAR(26)") @@ -105,7 +105,7 @@ public void updateFamilyName(String familyName, String loginFamilyId) { } private void validateFamilyName(String familyName) { - if ((familyName.codePoints().count() > 10) || familyName.isBlank()) { + if ((familyName.codePoints().count() > 9) || familyName.isBlank()) { throw new InvalidParameterException(); } } diff --git a/family/src/main/java/com/oing/dto/request/UpdateFamilyNameRequest.java b/family/src/main/java/com/oing/dto/request/UpdateFamilyNameRequest.java index 2343a880..7b340615 100644 --- a/family/src/main/java/com/oing/dto/request/UpdateFamilyNameRequest.java +++ b/family/src/main/java/com/oing/dto/request/UpdateFamilyNameRequest.java @@ -6,7 +6,7 @@ @Schema(description = "가족 이름 수정 요청") public record UpdateFamilyNameRequest( - @Size(max = 10) + @Size(max = 9) @Schema(description = "가족 이름", example = "오잉") String familyName ) { diff --git a/family/src/test/java/com/oing/service/FamilyServiceTest.java b/family/src/test/java/com/oing/service/FamilyServiceTest.java index e2f81c6f..9b0faa1d 100644 --- a/family/src/test/java/com/oing/service/FamilyServiceTest.java +++ b/family/src/test/java/com/oing/service/FamilyServiceTest.java @@ -51,9 +51,9 @@ public class FamilyServiceTest { } @Test - void 열_자_초과_가족_이름_수정_예외_검증() { + void 아홉_자_초과_가족_이름_수정_예외_검증() { // given - String newName = "wrong-length-name"; + String newName = "wrong-length-nam"; String memberId = "1"; String familyId = "1"; diff --git a/gateway/src/main/resources/V202406261718__alter_family_name_column_type.sql b/gateway/src/main/resources/V202406261718__alter_family_name_column_type.sql new file mode 100644 index 00000000..2bd6fed5 --- /dev/null +++ b/gateway/src/main/resources/V202406261718__alter_family_name_column_type.sql @@ -0,0 +1 @@ +ALTER TABLE `family` MODIFY `family_name` VARCHAR(9);