22 lines
820 B
Python
22 lines
820 B
Python
"""sys_config 运营参数表 ORM 模型(高净值门槛/偏离阈值等,免发版调整)。"""
|
|
from __future__ import annotations
|
|
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import BigInteger, DateTime, String, func
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from model.base import Base
|
|
|
|
|
|
class SysConfig(Base):
|
|
__tablename__ = "sys_config"
|
|
__table_args__ = {"comment": "运营参数 KV 表"}
|
|
|
|
id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
|
|
config_key: Mapped[str] = mapped_column(String(64), unique=True)
|
|
config_value: Mapped[str] = mapped_column(String(255))
|
|
description: Mapped[str | None] = mapped_column(String(255))
|
|
update_time: Mapped[datetime] = mapped_column(
|
|
DateTime, server_default=func.now(), onupdate=func.now()
|
|
) |