class OnBattleModel(Base): __tablename__ = 'on_battle' id = Column(Integer(), primary_key=True, autoincrement=True) user_id = Column(Integer(), nullable=False, server_default='0') # 段位0青铜, 1白银, 2黄金, 3铂金, 4钻石, 5王者 rank = Column(Integer(1), nullable=False, server_default='0') # 几星, 默认0 star = Column(Integer(), nullable=False, server_default='0') # rank分数 rank_score = Column(Integer(16), nullable=False, server_default='0') # 胜利场次 win_num = Column(Integer(16), nullable=False, server_default='0') # 失败场次 lose_num = Column(Integer(16), nullable=False, server_default='0') # 猜对歌曲总数 right_num = Column(Integer(16), nullable=False, server_default='0') # 未猜对总数 error_num = Column(Integer(16), nullable=False, server_default='0') Column(Integer(16), nullable=False, server_default='0') create_time = Column(DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP')) update_time = Column( DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')) if settings.CREATE_TABLE: create_table("off_battle")
class OnBattleRecordModel(Base): __tablename__ = 'on_battle_record' id = Column(Integer(), primary_key=True, autoincrement=True) user_id = Column(Integer(), nullable=False, server_default='0') # 段位0青铜, 1白银, 2黄金, 3铂金, 4钻石, 5王者 rank = Column(Integer(), nullable=False, server_default='0') # 几星, 默认0 star = Column(Integer(), nullable=False, server_default='0') # rank分数 rank_score = Column(Integer(), nullable=False, server_default='0') # 胜利场次 win_num = Column(Integer(), nullable=False, server_default='0') # 失败场次 lose_num = Column(Integer(), nullable=False, server_default='0') # 猜对歌曲总数 right_num = Column(Integer(), nullable=False, server_default='0') # 未猜对总数 error_num = Column(Integer(), nullable=False, server_default='0') Column(Integer(), nullable=False, server_default='0') create_time = Column(DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP')) update_time = Column( DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')) if settings.CREATE_TABLE: create_table("on_battle_record")
#!/bin/env python # -*- coding:utf8 -*- from sqlalchemy import Column, String, Integer, DateTime, text from common.sqlalchemy_ctl import Base from common.utility import create_table from conf import settings class UserModel(Base): __tablename__ = 'user' id = Column(Integer(), primary_key=True, autoincrement=True) name = Column(String(256), nullable=False, server_default='') password = Column(String(256), nullable=False, server_default='') avatar = Column(String(256), nullable=False, server_default='') create_time = Column(DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP')) # 更新时间 update_time = Column( DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')) if settings.CREATE_TABLE: create_table("user")
class OffBattleRecordModel(Base): __tablename__ = 'battle_record' id = Column(Integer(), primary_key=True, autoincrement=True) user_id = Column(Integer(), nullable=False, server_default='0') # 段位0青铜, 1白银, 2黄金, 3铂金, 4钻石, 5王者 rank = Column(Integer(), nullable=False, server_default='0') # 几星, 默认0 star = Column(Integer(), nullable=False, server_default='0') # rank分数 rank_score = Column(Integer(), nullable=False, server_default='0') # 胜利场次 win_num = Column(Integer(), nullable=False, server_default='0') # 失败场次 lose_num = Column(Integer(), nullable=False, server_default='0') # 猜对歌曲总数 right_num = Column(Integer(), nullable=False, server_default='0') # 未猜对总数 error_num = Column(Integer(), nullable=False, server_default='0') Column(Integer(), nullable=False, server_default='0') create_time = Column(DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP')) update_time = Column( DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')) if settings.CREATE_TABLE: create_table("battle_record")
#!/bin/env python # -*- coding:utf8 -*- from sqlalchemy import Column, String, Integer, DateTime, text from common.sqlalchemy_ctl import Base from common.utility import create_table from conf import settings class User(Base): __tablename__ = 'account_user' id = Column(Integer(), primary_key=True, autoincrement=True) name = Column(String(50), nullable=False, server_default='') password = Column(String(50), nullable=False, server_default='') phone = Column(String(50), nullable=False, server_default='') create_time = Column(DateTime, nullable=False, server_default=text('CURRENT_TIMESTAMP')) if settings.CREATE_TABLE: create_table("account_user")
from common.sqlalchemy_ctl import Base from common.utility import create_table from conf import settings class User(Base): __tablename__ = 'system_user' id = Column(Integer(), primary_key=True, autoincrement=True) # 父项目 parent_id = Column(Integer(), nullable=False, server_default='0') # 名称 name = Column(String(256), nullable=False, server_default='') # 类型,内网还是外网 web_type = Column(String(256), nullable=False, server_default='') # 更新时间 update_time = Column( DateTime(), nullable=False, server_default=text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP')) # 负责人1 principal1 = Column(Integer(), nullable=False, server_default='0') # 负责人2 principal2 = Column(Integer(), nullable=False, server_default='0') # 备注 remark = Column(String(256), nullable=False, server_default='') if settings.CREATE_TABLE: create_table("system_user")