system_config.py 676 B

123456789101112131415
  1. from sqlalchemy import Column, Integer, String, DateTime
  2. from sqlalchemy.sql import func
  3. from app.core.database import Base
  4. class SystemConfig(Base):
  5. __tablename__ = "system_configs"
  6. id = Column(Integer, primary_key=True, index=True)
  7. key = Column(String(50), unique=True, index=True, nullable=False, comment="Configuration Key")
  8. value = Column(String(255), nullable=True, comment="Configuration Value")
  9. description = Column(String(255), nullable=True, comment="Description")
  10. created_at = Column(DateTime(timezone=True), server_default=func.now())
  11. updated_at = Column(DateTime(timezone=True), onupdate=func.now(), server_default=func.now())