파이썬(/appserver/apps/account/models.py)
# 생략
class OAuthAccount(SQLModel, table=True):
__tablename__ = "oauth_accounts"
__table_args__ = (
UniqueConstraint(
"provider",
"provider_account_id",
name="uq_provider_provider_account_id",
),
)
id: int = Field(default=None, primary_key=True)
provider: str = Field(max_length=10, description="OAuth 제공자")
provider_account_id: str = Field(max_length=128, description="OAuth 제공자 계정 ID")
user_id: int = Field(foreign_key="users.id")
user: User = Relationship(back_populates="oauth_accounts")