mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
* 🗃️ 自定义表名 * ➕ 添加开发依赖 nonebot-plugin-orm[postgresql] * 🗃️ postgresql 跳过所有旧迁移脚本 * 🗃️ 修正方言 * 🗃️ 添加迁移脚本 * 🚨 auto fix by pre-commit hooks * 🚨 添加一个 noqa( --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
20 lines
784 B
Python
20 lines
784 B
Python
from datetime import datetime
|
|
from typing import Literal
|
|
|
|
from nonebot_plugin_orm import Model
|
|
from sqlalchemy import DateTime, String
|
|
from sqlalchemy.orm import Mapped, MappedAsDataclass, mapped_column
|
|
|
|
from ....db.models import PydanticType
|
|
from .schemas.user_profile import UserProfile
|
|
|
|
|
|
class TOPHistoricalData(MappedAsDataclass, Model):
|
|
__tablename__ = 'nb_t_top_hist_data'
|
|
|
|
id: Mapped[int] = mapped_column(init=False, primary_key=True)
|
|
user_unique_identifier: Mapped[str] = mapped_column(String(24), index=True)
|
|
api_type: Mapped[Literal['User Profile']] = mapped_column(String(16), index=True)
|
|
data: Mapped[UserProfile] = mapped_column(PydanticType(get_model=[], models={UserProfile}))
|
|
update_time: Mapped[datetime] = mapped_column(DateTime, index=True)
|