diff --git a/src/main/java/net/teumteum/user/domain/OAuth.java b/src/main/java/net/teumteum/user/domain/OAuth.java index 32011235..0ccbbd38 100644 --- a/src/main/java/net/teumteum/user/domain/OAuth.java +++ b/src/main/java/net/teumteum/user/domain/OAuth.java @@ -19,6 +19,6 @@ public class OAuth { private String oauthId; @Enumerated(EnumType.STRING) - @Column(name = "provider_type", nullable = false) + @Column(name = "authenticated", nullable = false) private Authenticated authenticated; } diff --git a/src/main/java/net/teumteum/user/domain/User.java b/src/main/java/net/teumteum/user/domain/User.java index 63cc9c52..d166cc58 100644 --- a/src/main/java/net/teumteum/user/domain/User.java +++ b/src/main/java/net/teumteum/user/domain/User.java @@ -1,20 +1,6 @@ package net.teumteum.user.domain; -import jakarta.persistence.Column; -import jakarta.persistence.ElementCollection; -import jakarta.persistence.Embedded; -import jakarta.persistence.Entity; -import jakarta.persistence.EnumType; -import jakarta.persistence.Enumerated; -import jakarta.persistence.FetchType; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import jakarta.persistence.PrePersist; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import jakarta.persistence.*; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; @@ -22,6 +8,11 @@ import org.springframework.format.annotation.DateTimeFormat; import org.springframework.util.Assert; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + @Getter @Entity(name = "users") @NoArgsConstructor @@ -50,7 +41,7 @@ public class User extends TimeBaseEntity { private OAuth oauth; @Enumerated(EnumType.STRING) - @Column(name = "role", nullable = false) + @Column(name = "role_type", nullable = false) private RoleType roleType; @Embedded diff --git a/src/main/resources/db/migration/V1__create_users.sql b/src/main/resources/db/migration/V1__create_users.sql index 08626b0e..023d14b6 100644 --- a/src/main/resources/db/migration/V1__create_users.sql +++ b/src/main/resources/db/migration/V1__create_users.sql @@ -7,8 +7,9 @@ create table if not exists users( birth varchar(10), name varchar(10), goal varchar(50), - authenticated varchar(255), - oauth_authenticate_info varchar(255) unique, + oauth_id varchar(255) not null, unique, + authenticated varchar(255) not null, + role_type varchar(255) not null city varchar(255), detail_job_class varchar(255), job_class varchar(255),