mirror of
https://github.com/fastapi-practices/fastapi-best-architecture.git
synced 2026-09-23 05:30:54 +00:00
* Update the length style of the model columns * Fix opera log table username column length * Fix login log table username column length
20 lines
774 B
Python
20 lines
774 B
Python
import sqlalchemy as sa
|
|
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
|
|
from backend.common.model import Base, UniversalText, id_key
|
|
|
|
|
|
class Config(Base):
|
|
"""参数配置表"""
|
|
|
|
__tablename__ = 'sys_config'
|
|
|
|
id: Mapped[id_key] = mapped_column(init=False)
|
|
name: Mapped[str] = mapped_column(sa.String(32), comment='名称')
|
|
type: Mapped[str | None] = mapped_column(sa.String(32), server_default=None, comment='类型')
|
|
key: Mapped[str] = mapped_column(sa.String(64), unique=True, comment='键名')
|
|
value: Mapped[str] = mapped_column(UniversalText, comment='键值')
|
|
is_frontend: Mapped[bool] = mapped_column(default=False, comment='是否前端')
|
|
remark: Mapped[str | None] = mapped_column(UniversalText, default=None, comment='备注')
|