""" 密钥轮换配置历史记录模型 """ from sqlalchemy import Column, Integer, DateTime, SmallInteger, String from app.database import Base class KeyRotationConfigHis(Base): """密钥轮换配置表历史记录""" __tablename__ = "key_rotation_config_his" his_id = Column(Integer, primary_key=True, autoincrement=True, comment="历史记录主键ID") id = Column(Integer, nullable=False, comment="原表主键ID") rotation_days = Column(Integer, default=10, comment="密钥轮换周期(天)") is_auto_rotate = Column(SmallInteger, default=1, comment="是否自动轮换") last_rotation_time = Column(DateTime, comment="最后轮换时间") next_rotation_time = Column(DateTime, comment="下次轮换时间") is_deleted = Column(SmallInteger, default=0, comment="是否删除:0-否,1-是") updated_at = Column(DateTime, comment="更新时间") his_created_at = Column(DateTime, comment="历史记录创建时间") his_operation = Column(String(10), nullable=False, comment="操作类型:INSERT/UPDATE/DELETE")