2022-08-04 13:18:23 +00:00
|
|
|
from typing import Optional
|
2022-07-26 10:07:31 +00:00
|
|
|
|
2022-08-05 12:03:57 +00:00
|
|
|
from sqlmodel import SQLModel, Field, Enum, Column
|
|
|
|
|
2022-09-08 01:08:37 +00:00
|
|
|
from utils.models.base import RegionEnum
|
2022-07-26 10:07:31 +00:00
|
|
|
|
2022-08-04 13:18:23 +00:00
|
|
|
|
|
|
|
class User(SQLModel, table=True):
|
2022-09-04 05:52:33 +00:00
|
|
|
__table_args__ = dict(mysql_charset='utf8mb4', mysql_collate="utf8mb4_general_ci")
|
|
|
|
|
|
|
|
id: int = Field(primary_key=True)
|
|
|
|
user_id: int = Field(unique=True)
|
|
|
|
yuanshen_uid: Optional[int] = Field()
|
|
|
|
genshin_uid: Optional[int] = Field()
|
2022-08-05 12:03:57 +00:00
|
|
|
region: Optional[RegionEnum] = Field(sa_column=Column(Enum(RegionEnum)))
|