# coding: utf-8 from sqlalchemy import Column, DateTime, Integer, String, text from sqlalchemy.dialects.mysql import VARCHAR from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() metadata = Base.metadata class FootballMatch(Base): __tablename__ = 'football_match' __table_args__ = {'comment': '足球比赛表'} id = Column(Integer, primary_key=True) issue = Column(VARCHAR(255)) match_date = Column(DateTime, comment='比赛时间') buy_end_time = Column(DateTime, comment='购买截至时间') league_name = Column(String(255, 'utf8mb4_general_ci'), comment='联赛名') home_name = Column(VARCHAR(255), comment='主队') away_name = Column(VARCHAR(255), comment='客队') half_score = Column(String(10, 'utf8mb4_general_ci'), comment='半场比分') score = Column(String(10, 'utf8mb4_general_ci'), comment='全场比分') total_goal_count = Column(Integer, comment='总进球数') result = Column(Integer, comment='结果:0 负 1 平 3 胜') rq_count = Column(Integer, comment='让球数') rq_result = Column(Integer, comment='让球结果:0 负 1 平 3 胜') spf_odds_ranking = Column(Integer, comment='胜平负赔率排名') bf_odds_ranking = Column(Integer, comment='比分赔率排名') bqc_odds_ranking = Column(Integer, comment='半全场赔率排名') zjq_odds_ranking = Column(Integer, comment='总进球数赔率排名') created_at = Column(DateTime, server_default=text("CURRENT_TIMESTAMP"))