18 lines
518 B
Python
18 lines
518 B
Python
|
|
"""SystemConfig ORM model - 系统配置键值表。"""
|
||
|
|
|
||
|
|
from sqlalchemy import Column, DateTime, String
|
||
|
|
from sqlalchemy.sql import func
|
||
|
|
|
||
|
|
from .base import Base
|
||
|
|
|
||
|
|
|
||
|
|
class SystemConfig(Base):
|
||
|
|
__tablename__ = "system_config"
|
||
|
|
|
||
|
|
key = Column(String(64), primary_key=True)
|
||
|
|
value = Column(String(500), nullable=False, default="")
|
||
|
|
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
||
|
|
|
||
|
|
def __repr__(self):
|
||
|
|
return f"<SystemConfig(key='{self.key}', value='{self.value[:30]}')>"
|