software.py 914 B

1234567891011121314151617181920
  1. """
  2. 软件模型
  3. """
  4. from sqlalchemy import Column, Integer, String, DateTime, Numeric, SmallInteger, Text
  5. from app.database import Base
  6. class Software(Base):
  7. """软件表"""
  8. __tablename__ = "software"
  9. id = Column(Integer, primary_key=True, index=True, comment="主键ID")
  10. code = Column(String(50), unique=True, nullable=False, index=True, comment="软件特征码")
  11. name = Column(String(100), nullable=False, comment="软件名称")
  12. description = Column(Text, comment="软件描述")
  13. daily_price = Column(Numeric(10, 2), nullable=False, default=0.00, comment="每天收费基数")
  14. is_active = Column(SmallInteger, default=1, index=True, comment="是否启用")
  15. is_deleted = Column(SmallInteger, default=0, index=True, comment="是否删除:0-否,1-是")
  16. created_at = Column(DateTime, comment="创建时间")
  17. updated_at = Column(DateTime, comment="更新时间")