added roundstats with eco info, switched to avatar hash
This commit is contained in:
@@ -33,7 +33,7 @@ var (
|
||||
PlayersColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeUint64, Increment: true},
|
||||
{Name: "name", Type: field.TypeString, Nullable: true},
|
||||
{Name: "avatar_url", 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", Type: field.TypeBool, Default: false},
|
||||
@@ -50,6 +50,29 @@ var (
|
||||
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: "stats_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_stats_round_stats",
|
||||
Columns: []*schema.Column{RoundStatsColumns[5]},
|
||||
RefColumns: []*schema.Column{StatsColumns[0]},
|
||||
OnDelete: schema.SetNull,
|
||||
},
|
||||
},
|
||||
}
|
||||
// StatsColumns holds the columns for the "stats" table.
|
||||
StatsColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeInt, Increment: true},
|
||||
@@ -165,6 +188,7 @@ var (
|
||||
Tables = []*schema.Table{
|
||||
MatchesTable,
|
||||
PlayersTable,
|
||||
RoundStatsTable,
|
||||
StatsTable,
|
||||
WeaponStatsTable,
|
||||
PlayerMatchesTable,
|
||||
@@ -172,6 +196,7 @@ var (
|
||||
)
|
||||
|
||||
func init() {
|
||||
RoundStatsTable.ForeignKeys[0].RefTable = StatsTable
|
||||
StatsTable.ForeignKeys[0].RefTable = MatchesTable
|
||||
StatsTable.ForeignKeys[1].RefTable = PlayersTable
|
||||
WeaponStatsTable.ForeignKeys[0].RefTable = StatsTable
|
||||
|
Reference in New Issue
Block a user