사용자의 uuid -> ksuid로 변경, 테이블 구조 변경
This commit is contained in:
1 parent
dc7351d0f9
commit
aa8d9d7c14
13 files changed
+170
-75
No files matched your search
+18
-1
@@ -26,6 +26,7 @@ class User(Base):
|
||||
Attributes:
|
||||
id: 고유 식별자 (자동 증가)
|
||||
kakao_id: 카카오 고유 ID (필수, 유니크)
|
||||
user_ksuid: 사용자 식별을 위한 KSUID (필수, 유니크)
|
||||
email: 이메일 주소 (선택, 카카오에서 제공 시)
|
||||
nickname: 카카오 닉네임 (선택)
|
||||
profile_image_url: 카카오 프로필 이미지 URL (선택)
|
||||
@@ -68,7 +69,8 @@ class User(Base):
|
||||
|
||||
__tablename__ = "user"
|
||||
__table_args__ = (
|
||||
Index("idx_user_kakao_id", "kakao_id", unique=True),
|
||||
Index("idx_user_kakao_id", "kakao_id"),
|
||||
Index("idx_user_ksuid", "user_ksuid"),
|
||||
Index("idx_user_email", "email"),
|
||||
Index("idx_user_phone", "phone"),
|
||||
Index("idx_user_is_active", "is_active"),
|
||||
@@ -103,6 +105,13 @@ class User(Base):
|
||||
comment="카카오 고유 ID (회원번호)",
|
||||
)
|
||||
|
||||
user_ksuid: Mapped[str] = mapped_column(
|
||||
String(27),
|
||||
nullable=False,
|
||||
unique=True,
|
||||
comment="사용자 식별을 위한 KSUID (K-Sortable Unique Identifier)",
|
||||
)
|
||||
|
||||
# ==========================================================================
|
||||
# 카카오에서 제공하는 사용자 정보 (선택적)
|
||||
# ==========================================================================
|
||||
@@ -282,6 +291,7 @@ class RefreshToken(Base):
|
||||
Attributes:
|
||||
id: 고유 식별자 (자동 증가)
|
||||
user_id: 사용자 외래키 (User.id 참조)
|
||||
user_ksuid: 사용자 KSUID (User.user_ksuid 참조)
|
||||
token_hash: 리프레시 토큰의 SHA-256 해시값 (원본 저장 X)
|
||||
expires_at: 토큰 만료 일시
|
||||
is_revoked: 토큰 폐기 여부 (로그아웃 시 True)
|
||||
@@ -299,6 +309,7 @@ class RefreshToken(Base):
|
||||
__tablename__ = "refresh_token"
|
||||
__table_args__ = (
|
||||
Index("idx_refresh_token_user_id", "user_id"),
|
||||
Index("idx_refresh_token_user_ksuid", "user_ksuid"),
|
||||
Index("idx_refresh_token_token_hash", "token_hash", unique=True),
|
||||
Index("idx_refresh_token_expires_at", "expires_at"),
|
||||
Index("idx_refresh_token_is_revoked", "is_revoked"),
|
||||
@@ -324,6 +335,12 @@ class RefreshToken(Base):
|
||||
comment="사용자 외래키 (User.id 참조)",
|
||||
)
|
||||
|
||||
user_ksuid: Mapped[str] = mapped_column(
|
||||
String(27),
|
||||
nullable=False,
|
||||
comment="사용자 KSUID (User.user_ksuid 참조)",
|
||||
)
|
||||
|
||||
token_hash: Mapped[str] = mapped_column(
|
||||
String(64),
|
||||
nullable=False,
|
||||
|
||||
Reference in new issue
Block a user