| 12345678910111213141516171819202122232425262728 |
- """
- 系统配置历史记录模型
- """
- from datetime import datetime
- from app.utils.timezone import beijing_now_naive
- from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text
- from app.database import Base
- from app.models.history_base import HistoryRecord
- class SystemConfigHis(HistoryRecord):
- """系统配置历史记录表"""
- __tablename__ = "system_config_his"
-
- id = Column(Integer, primary_key=True, comment="原表主键ID")
- config_key = Column(String(100), nullable=False, comment="配置键名")
- config_value = Column(Text, nullable=True, comment="配置值")
- config_type = Column(String(20), default="string", comment="类型: int/string/bool/json")
- app_name = Column(String(50), nullable=True, comment="所属应用")
- description = Column(String(255), nullable=True, comment="配置描述")
- is_system = Column(Boolean, default=False, comment="是否系统配置")
- is_editable = Column(Boolean, default=True, comment="是否可编辑")
- is_deleted = Column(Boolean, default=False, comment="是否删除")
- created_at = Column(DateTime, default=beijing_now_naive, comment="创建时间")
- updated_at = Column(DateTime, default=beijing_now_naive, comment="更新时间")
-
- def __repr__(self):
- return f"<SystemConfigHis(id={self.id}, config_key='{self.config_key}', his_operation='{self.his_operation}')>"
|