key_rotation_config_his.py 1.0 KB

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