示例#1
0
 def sql_table(cls) -> sql_tables.Table:
     if cls.table is None:
         cls.table = sql_tables.Table(
             cls.__name__, sql_columns.id_column(),
             [sql_columns.id_column(),
              sql_columns.name_column()])
     return cls.table
示例#2
0
 def sql_table(cls) -> Table:
     if cls.table is None:
         competition_column = Column(ColumnNames.Competition_ID.name,
                                     Affinity.INTEGER)
         home_team_column = Column(ColumnNames.Home_ID.name,
                                   Affinity.INTEGER)
         away_team_column = Column(ColumnNames.Away_ID.name,
                                   Affinity.INTEGER)
         cls.table = Table(cls.__name__, id_column(), [
             id_column(),
             Column(ColumnNames.Season_ID.name,
                    Affinity.INTEGER), competition_column,
             Column(ColumnNames.Match_Date.name,
                    Affinity.TEXT), home_team_column,
             Column(ColumnNames.Home_Score_HT.name, Affinity.INTEGER),
             Column(ColumnNames.Home_Score_FT.name, Affinity.INTEGER),
             Column(ColumnNames.Home_Lineup.name, Affinity.BLOB),
             Column(ColumnNames.Home_Bench.name, Affinity.BLOB),
             Column(ColumnNames.Home_Substitutions.name, Affinity.BLOB),
             away_team_column,
             Column(ColumnNames.Away_Score_HT.name, Affinity.INTEGER),
             Column(ColumnNames.Away_Score_FT.name, Affinity.INTEGER),
             Column(ColumnNames.Away_Lineup.name, Affinity.BLOB),
             Column(ColumnNames.Away_Bench.name, Affinity.BLOB),
             Column(ColumnNames.Away_Substitutions.name, Affinity.BLOB)
         ])
         cls.table.add_foreign_key(competition_column,
                                   Competition.sql_table())
         cls.table.add_foreign_key(home_team_column, Team.sql_table())
         cls.table.add_foreign_key(away_team_column, Team.sql_table())
     return cls.table
示例#3
0
 def sql_table(cls) -> sql_tables.Table:
     if cls.table is None:
         cls.table = sql_tables.Table(
             cls.__name__, sql_columns.id_column(), [
                 sql_columns.id_column(),
                 sql_columns.name_column(),
                 Column(ColumnNames.Date_Of_Birth.name, Affinity.TEXT)
             ])
     return cls.table
示例#4
0
 def sql_table(cls) -> sql_tables.Table:
     if cls.table is None:
         cls.table = sql_tables.Table(
             cls.__name__, sql_columns.id_column(), [
                 sql_columns.id_column(),
                 sql_columns.name_column(),
                 Column(ColumnNames.Country.name, Affinity.TEXT),
                 Column(ColumnNames.Logo.name, Affinity.TEXT)
             ])
     return cls.table
示例#5
0
 def sql_table(cls) -> sql_tables.Table:
     if cls.table is None:
         cls.table = sql_tables.Table(
             cls.__name__, sql_columns.id_column(), [
                 sql_columns.id_column(),
                 Column(ColumnNames.Year.name, Affinity.INTEGER),
                 Column(ColumnNames.Code.name, Affinity.TEXT),
                 Column(ColumnNames.Country.name, Affinity.TEXT),
                 Column(ColumnNames.Country_Code.name, Affinity.TEXT),
                 Column(ColumnNames.Flag.name, Affinity.TEXT),
                 Column(ColumnNames.Current.name, Affinity.INTEGER)
             ])
     return cls.table
示例#6
0
 def sql_table(cls) -> sql_tables.Table:
     if cls.table is None:
         cls.table = sql_tables.Table(
             cls.__name__, sql_columns.id_column(), [
                 sql_columns.id_column(),
                 Column(ColumnNames.Date.name, Affinity.TEXT),
                 Column(ColumnNames.Season_ID.name, Affinity.INTEGER),
                 Column(ColumnNames.Home_ID.name, Affinity.INTEGER),
                 Column(ColumnNames.Away_ID.name, Affinity.INTEGER),
                 Column(ColumnNames.Half_Time.name, Affinity.TEXT),
                 Column(ColumnNames.Full_Time.name, Affinity.TEXT),
                 Column(ColumnNames.Finished.name, Affinity.INTEGER),
                 Column(ColumnNames.Updated.name, Affinity.TEXT)
             ])
     return cls.table
示例#7
0
 def sql_table(cls) -> sql_tables.Table:
     if cls.table is None:
         match_column = Column(ColumnNames.Match_ID.name, Affinity.INTEGER)
         player_column = Column(ColumnNames.Player_ID.name,
                                Affinity.INTEGER)
         team_column = Column(ColumnNames.Team_ID.name, Affinity.INTEGER)
         cls.table = sql_tables.Table(
             cls.__name__, sql_columns.id_column(), [
                 sql_columns.id_column(), match_column, player_column,
                 team_column,
                 Column(ColumnNames.Period.name, Affinity.INTEGER),
                 Column(ColumnNames.Timestamp.name, Affinity.REAL),
                 Column(ColumnNames.Event_ID.name, Affinity.INTEGER),
                 Column(ColumnNames.Sub_Event_ID.name, Affinity.INTEGER),
                 Column(ColumnNames.Tags.name, Affinity.BLOB),
                 Column(ColumnNames.From_Position.name, Affinity.BLOB),
                 Column(ColumnNames.To_Position.name, Affinity.BLOB)
             ])
         cls.table.add_foreign_key(match_column, Match.sql_table())
         cls.table.add_foreign_key(player_column, Player.sql_table())
         cls.table.add_foreign_key(team_column, Team.sql_table())
     return cls.table