modify set ver1
This commit is contained in:
1 parent
19bd12d581
commit
08d47a6990
21 files changed
+2435
-398
No files matched your search
+22
-11
@@ -5,6 +5,7 @@ User 모듈 SQLAlchemy 모델 정의
|
||||
"""
|
||||
|
||||
from datetime import date, datetime
|
||||
from enum import Enum
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
|
||||
from sqlalchemy import BigInteger, Boolean, Date, DateTime, ForeignKey, Index, Integer, String, Text, func
|
||||
@@ -13,6 +14,7 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.database.session import Base
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from app.home.models import Project
|
||||
|
||||
@@ -403,6 +405,15 @@ class RefreshToken(Base):
|
||||
)
|
||||
|
||||
|
||||
class Platform(str, Enum):
|
||||
"""소셜 플랫폼 구분"""
|
||||
|
||||
YOUTUBE = "youtube"
|
||||
INSTAGRAM = "instagram"
|
||||
FACEBOOK = "facebook"
|
||||
TIKTOK = "tiktok"
|
||||
|
||||
|
||||
class SocialAccount(Base):
|
||||
"""
|
||||
소셜 계정 연동 테이블
|
||||
@@ -475,10 +486,10 @@ class SocialAccount(Base):
|
||||
# ==========================================================================
|
||||
# 플랫폼 구분
|
||||
# ==========================================================================
|
||||
platform: Mapped[str] = mapped_column(
|
||||
platform: Mapped[Platform] = mapped_column(
|
||||
String(20),
|
||||
nullable=False,
|
||||
comment="플랫폼 구분 (youtube, instagram, facebook)",
|
||||
comment="플랫폼 구분 (youtube, instagram, facebook, tiktok)",
|
||||
)
|
||||
|
||||
# ==========================================================================
|
||||
@@ -513,7 +524,7 @@ class SocialAccount(Base):
|
||||
# ==========================================================================
|
||||
platform_user_id: Mapped[str] = mapped_column(
|
||||
String(100),
|
||||
nullable=False,
|
||||
nullable=True,
|
||||
comment="플랫폼 내 사용자 고유 ID",
|
||||
)
|
||||
|
||||
@@ -539,7 +550,7 @@ class SocialAccount(Base):
|
||||
Boolean,
|
||||
nullable=False,
|
||||
default=True,
|
||||
comment="연동 활성화 상태 (비활성화 시 사용 중지)",
|
||||
comment="활성화 상태 (비활성화 시 사용 중지)",
|
||||
)
|
||||
|
||||
is_deleted: Mapped[bool] = mapped_column(
|
||||
@@ -552,13 +563,6 @@ class SocialAccount(Base):
|
||||
# ==========================================================================
|
||||
# 시간 정보
|
||||
# ==========================================================================
|
||||
connected_at: Mapped[datetime] = mapped_column(
|
||||
DateTime,
|
||||
nullable=False,
|
||||
server_default=func.now(),
|
||||
comment="연동 일시",
|
||||
)
|
||||
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime,
|
||||
nullable=False,
|
||||
@@ -567,6 +571,13 @@ class SocialAccount(Base):
|
||||
comment="정보 수정 일시",
|
||||
)
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime,
|
||||
nullable=False,
|
||||
server_default=func.now(),
|
||||
comment="생성 일시",
|
||||
)
|
||||
|
||||
# ==========================================================================
|
||||
# User 관계
|
||||
# ==========================================================================
|
||||
|
||||
Reference in new issue
Block a user