Files
csgowtfd/ent/migrate/schema.go

254 lines
10 KiB
Go

// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// MatchesColumns holds the columns for the "matches" table.
MatchesColumns = []*schema.Column{
{Name: "id", Type: field.TypeUint64, Increment: true},
{Name: "share_code", Type: field.TypeString},
{Name: "map", Type: field.TypeString, Nullable: true},
{Name: "date", Type: field.TypeTime},
{Name: "score_team_a", Type: field.TypeInt},
{Name: "score_team_b", Type: field.TypeInt},
{Name: "replay_url", Type: field.TypeString, Nullable: true},
{Name: "duration", Type: field.TypeInt},
{Name: "match_result", Type: field.TypeInt},
{Name: "max_rounds", Type: field.TypeInt},
{Name: "demo_parsed", Type: field.TypeBool, Default: false},
{Name: "vac_present", Type: field.TypeBool, Default: false},
{Name: "gameban_present", Type: field.TypeBool, Default: false},
{Name: "decryption_key", Type: field.TypeBytes, Nullable: true},
{Name: "tick_rate", Type: field.TypeFloat64, Nullable: true},
}
// MatchesTable holds the schema information for the "matches" table.
MatchesTable = &schema.Table{
Name: "matches",
Columns: MatchesColumns,
PrimaryKey: []*schema.Column{MatchesColumns[0]},
}
// MatchPlayersColumns holds the columns for the "match_players" table.
MatchPlayersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "team_id", Type: field.TypeInt},
{Name: "kills", Type: field.TypeInt},
{Name: "deaths", Type: field.TypeInt},
{Name: "assists", Type: field.TypeInt},
{Name: "headshot", Type: field.TypeInt},
{Name: "mvp", Type: field.TypeUint},
{Name: "score", Type: field.TypeInt},
{Name: "rank_new", Type: field.TypeInt, Nullable: true},
{Name: "rank_old", Type: field.TypeInt, Nullable: true},
{Name: "mk_2", Type: field.TypeUint, Nullable: true},
{Name: "mk_3", Type: field.TypeUint, Nullable: true},
{Name: "mk_4", Type: field.TypeUint, Nullable: true},
{Name: "mk_5", Type: field.TypeUint, Nullable: true},
{Name: "dmg_enemy", Type: field.TypeUint, Nullable: true},
{Name: "dmg_team", Type: field.TypeUint, Nullable: true},
{Name: "ud_he", Type: field.TypeUint, Nullable: true},
{Name: "ud_flames", Type: field.TypeUint, Nullable: true},
{Name: "ud_flash", Type: field.TypeUint, Nullable: true},
{Name: "ud_decoy", Type: field.TypeUint, Nullable: true},
{Name: "ud_smoke", Type: field.TypeUint, Nullable: true},
{Name: "crosshair", Type: field.TypeString, Nullable: true},
{Name: "color", Type: field.TypeEnum, Nullable: true, Enums: []string{"green", "yellow", "purple", "blue", "orange", "grey"}},
{Name: "kast", Type: field.TypeInt, Nullable: true},
{Name: "flash_duration_self", Type: field.TypeFloat32, Nullable: true},
{Name: "flash_duration_team", Type: field.TypeFloat32, Nullable: true},
{Name: "flash_duration_enemy", Type: field.TypeFloat32, Nullable: true},
{Name: "flash_total_self", Type: field.TypeUint, Nullable: true},
{Name: "flash_total_team", Type: field.TypeUint, Nullable: true},
{Name: "flash_total_enemy", Type: field.TypeUint, Nullable: true},
{Name: "flash_assists", Type: field.TypeInt, Nullable: true},
{Name: "match_stats", Type: field.TypeUint64, Nullable: true},
{Name: "player_stats", Type: field.TypeUint64, Nullable: true},
}
// MatchPlayersTable holds the schema information for the "match_players" table.
MatchPlayersTable = &schema.Table{
Name: "match_players",
Columns: MatchPlayersColumns,
PrimaryKey: []*schema.Column{MatchPlayersColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "match_players_matches_stats",
Columns: []*schema.Column{MatchPlayersColumns[31]},
RefColumns: []*schema.Column{MatchesColumns[0]},
OnDelete: schema.SetNull,
},
{
Symbol: "match_players_players_stats",
Columns: []*schema.Column{MatchPlayersColumns[32]},
RefColumns: []*schema.Column{PlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// MessagesColumns holds the columns for the "messages" table.
MessagesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "message", Type: field.TypeString, Size: 2147483647},
{Name: "all_chat", Type: field.TypeBool},
{Name: "tick", Type: field.TypeInt},
{Name: "match_player_messages", Type: field.TypeInt, Nullable: true},
}
// MessagesTable holds the schema information for the "messages" table.
MessagesTable = &schema.Table{
Name: "messages",
Columns: MessagesColumns,
PrimaryKey: []*schema.Column{MessagesColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "messages_match_players_messages",
Columns: []*schema.Column{MessagesColumns[4]},
RefColumns: []*schema.Column{MatchPlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// PlayersColumns holds the columns for the "players" table.
PlayersColumns = []*schema.Column{
{Name: "id", Type: field.TypeUint64, Increment: true},
{Name: "name", Type: field.TypeString, Nullable: true},
{Name: "avatar", Type: field.TypeString, Nullable: true},
{Name: "vanity_url", Type: field.TypeString, Nullable: true},
{Name: "vanity_url_real", Type: field.TypeString, Nullable: true},
{Name: "vac_date", Type: field.TypeTime, Nullable: true},
{Name: "vac_count", Type: field.TypeInt, Nullable: true},
{Name: "game_ban_date", Type: field.TypeTime, Nullable: true},
{Name: "game_ban_count", Type: field.TypeInt, Nullable: true},
{Name: "steam_updated", Type: field.TypeTime},
{Name: "sharecode_updated", Type: field.TypeTime, Nullable: true},
{Name: "auth_code", Type: field.TypeString, Nullable: true},
{Name: "profile_created", Type: field.TypeTime, Nullable: true},
{Name: "oldest_sharecode_seen", Type: field.TypeString, Nullable: true},
{Name: "wins", Type: field.TypeInt, Nullable: true},
{Name: "looses", Type: field.TypeInt, Nullable: true},
{Name: "ties", Type: field.TypeInt, Nullable: true},
}
// PlayersTable holds the schema information for the "players" table.
PlayersTable = &schema.Table{
Name: "players",
Columns: PlayersColumns,
PrimaryKey: []*schema.Column{PlayersColumns[0]},
}
// RoundStatsColumns holds the columns for the "round_stats" table.
RoundStatsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "round", Type: field.TypeUint},
{Name: "bank", Type: field.TypeUint},
{Name: "equipment", Type: field.TypeUint},
{Name: "spent", Type: field.TypeUint},
{Name: "match_player_round_stats", Type: field.TypeInt, Nullable: true},
}
// RoundStatsTable holds the schema information for the "round_stats" table.
RoundStatsTable = &schema.Table{
Name: "round_stats",
Columns: RoundStatsColumns,
PrimaryKey: []*schema.Column{RoundStatsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "round_stats_match_players_round_stats",
Columns: []*schema.Column{RoundStatsColumns[5]},
RefColumns: []*schema.Column{MatchPlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// SpraysColumns holds the columns for the "sprays" table.
SpraysColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "weapon", Type: field.TypeInt},
{Name: "spray", Type: field.TypeBytes},
{Name: "match_player_spray", Type: field.TypeInt, Nullable: true},
}
// SpraysTable holds the schema information for the "sprays" table.
SpraysTable = &schema.Table{
Name: "sprays",
Columns: SpraysColumns,
PrimaryKey: []*schema.Column{SpraysColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "sprays_match_players_spray",
Columns: []*schema.Column{SpraysColumns[3]},
RefColumns: []*schema.Column{MatchPlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// WeaponsColumns holds the columns for the "weapons" table.
WeaponsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "victim", Type: field.TypeUint64},
{Name: "dmg", Type: field.TypeUint},
{Name: "eq_type", Type: field.TypeInt},
{Name: "hit_group", Type: field.TypeInt},
{Name: "match_player_weapon_stats", Type: field.TypeInt, Nullable: true},
}
// WeaponsTable holds the schema information for the "weapons" table.
WeaponsTable = &schema.Table{
Name: "weapons",
Columns: WeaponsColumns,
PrimaryKey: []*schema.Column{WeaponsColumns[0]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "weapons_match_players_weapon_stats",
Columns: []*schema.Column{WeaponsColumns[5]},
RefColumns: []*schema.Column{MatchPlayersColumns[0]},
OnDelete: schema.SetNull,
},
},
}
// PlayerMatchesColumns holds the columns for the "player_matches" table.
PlayerMatchesColumns = []*schema.Column{
{Name: "player_id", Type: field.TypeUint64},
{Name: "match_id", Type: field.TypeUint64},
}
// PlayerMatchesTable holds the schema information for the "player_matches" table.
PlayerMatchesTable = &schema.Table{
Name: "player_matches",
Columns: PlayerMatchesColumns,
PrimaryKey: []*schema.Column{PlayerMatchesColumns[0], PlayerMatchesColumns[1]},
ForeignKeys: []*schema.ForeignKey{
{
Symbol: "player_matches_player_id",
Columns: []*schema.Column{PlayerMatchesColumns[0]},
RefColumns: []*schema.Column{PlayersColumns[0]},
OnDelete: schema.Cascade,
},
{
Symbol: "player_matches_match_id",
Columns: []*schema.Column{PlayerMatchesColumns[1]},
RefColumns: []*schema.Column{MatchesColumns[0]},
OnDelete: schema.Cascade,
},
},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
MatchesTable,
MatchPlayersTable,
MessagesTable,
PlayersTable,
RoundStatsTable,
SpraysTable,
WeaponsTable,
PlayerMatchesTable,
}
)
func init() {
MatchPlayersTable.ForeignKeys[0].RefTable = MatchesTable
MatchPlayersTable.ForeignKeys[1].RefTable = PlayersTable
MessagesTable.ForeignKeys[0].RefTable = MatchPlayersTable
RoundStatsTable.ForeignKeys[0].RefTable = MatchPlayersTable
SpraysTable.ForeignKeys[0].RefTable = MatchPlayersTable
WeaponsTable.ForeignKeys[0].RefTable = MatchPlayersTable
PlayerMatchesTable.ForeignKeys[0].RefTable = PlayersTable
PlayerMatchesTable.ForeignKeys[1].RefTable = MatchesTable
}