diff --git a/src/main/java/com/newdeal/ledger/user/dto/UserDto.java b/src/main/java/com/newdeal/ledger/user/dto/UserDto.java index f529652..f96faab 100644 --- a/src/main/java/com/newdeal/ledger/user/dto/UserDto.java +++ b/src/main/java/com/newdeal/ledger/user/dto/UserDto.java @@ -6,16 +6,17 @@ import lombok.Data; import lombok.NoArgsConstructor; -@AllArgsConstructor -@NoArgsConstructor @Data +@NoArgsConstructor +@AllArgsConstructor public class UserDto { - private String email; - private String password; - private String name; - private String phone; - private String address; - private String profileImage; - private Date createdAt; - private String role; + private String email; + private String uuid; + private String password; + private String name; + private String phone; + private String address; + private String profileImage; + private Date createdAt; + private String role; } diff --git a/src/main/resources/db/data/afterMigrate.sql b/src/main/resources/db/data/afterMigrate.sql index 9ce36c8..ccfa827 100644 --- a/src/main/resources/db/data/afterMigrate.sql +++ b/src/main/resources/db/data/afterMigrate.sql @@ -6,9 +6,9 @@ TRUNCATE TABLE tag; TRUNCATE TABLE transaction; SET foreign_key_checks = 1; -INSERT INTO ymember (email, password, name, phone, address, profile_image, created_at, role) -VALUES ('user1@example.com', 'password1', 'User One', '123-456-7890', '123 Main St', null, '2023-01-01', 'USER'), - ('user2@example.com', 'password2', 'User Two', '234-567-8901', '234 Oak St', null, '2023-02-01', 'USER'); +INSERT INTO ymember (email, uuid, password, name, phone, address, profile_image, created_at, role) +VALUES ('user1@example.com', '123e4567-e89b-12d3-a456-556642440000', 'password1', 'User One', '123-456-7890', '123 Main St', null, '2023-01-01', 'USER'), + ('user2@example.com','123e4567-e89b-12d3-a456-556642440001', 'password2', 'User Two', '234-567-8901', '234 Oak St', null, '2023-02-01', 'USER'); diff --git a/src/main/resources/db/migration/V6__update_ymember_table.sql b/src/main/resources/db/migration/V6__update_ymember_table.sql new file mode 100644 index 0000000..a4265f4 --- /dev/null +++ b/src/main/resources/db/migration/V6__update_ymember_table.sql @@ -0,0 +1,2 @@ +-- uuid 컬럼 추가 +ALTER TABLE `ymember` ADD COLUMN `uuid` varchar(20) UNIQUE NOT NULL; \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/user-mapper.xml b/src/main/resources/mybatis/mapper/user-mapper.xml index e75b78f..fa6ebc0 100644 --- a/src/main/resources/mybatis/mapper/user-mapper.xml +++ b/src/main/resources/mybatis/mapper/user-mapper.xml @@ -6,8 +6,8 @@ - INSERT INTO ymember (email, password, name, phone, address, profile_image) - VALUES (#{email}, #{password}, #{name}, #{phone}, #{address}, #{profileImage}) + INSERT INTO ymember (email,uuid, password, name, phone, address, profile_image) + VALUES (#{email}, ${uuid}, #{password}, #{name}, #{phone}, #{address}, #{profileImage})