key_rotation_config.py 782 B

123456789101112131415161718
  1. """
  2. 密钥轮换配置模型
  3. """
  4. from sqlalchemy import Column, Integer, DateTime, SmallInteger
  5. from app.database import Base
  6. class KeyRotationConfig(Base):
  7. """密钥轮换配置表"""
  8. __tablename__ = "key_rotation_config"
  9. id = Column(Integer, primary_key=True, index=True, comment="主键ID")
  10. rotation_days = Column(Integer, default=10, comment="密钥轮换周期(天)")
  11. is_auto_rotate = Column(SmallInteger, default=1, comment="是否自动轮换")
  12. last_rotation_time = Column(DateTime, comment="最后轮换时间")
  13. next_rotation_time = Column(DateTime, comment="下次轮换时间")
  14. is_deleted = Column(SmallInteger, default=0, index=True, comment="是否删除:0-否,1-是")
  15. updated_at = Column(DateTime, comment="更新时间")