| 123456789101112131415 |
- from sqlalchemy import Column, Integer, String, BigInteger, Text, Index
- from database import Base
- class PointsConsumptionLog(Base):
- """积分消费记录表"""
- __tablename__ = "points_consumption_log"
- id = Column(BigInteger, primary_key=True, autoincrement=True)
- user_id = Column(String(255), nullable=False, index=True) # accountID,与Go版本一致
- file_name = Column(String(500), nullable=False) # 不允许为空
- file_url = Column(Text) # 允许为空
- points_consumed = Column(Integer, nullable=False, default=10) # 默认10积分
- balance_after = Column(Integer, nullable=False) # 消费后余额,不允许为空
- created_at = Column(Integer, default=0) # Unix时间戳
|