added vac/gameban marker for matches

This commit is contained in:
2021-10-28 08:47:41 +02:00
parent 25b153900f
commit 37233be336
14 changed files with 371 additions and 10 deletions

View File

@@ -27,6 +27,10 @@ const (
FieldMaxRounds = "max_rounds"
// FieldDemoParsed holds the string denoting the demo_parsed field in the database.
FieldDemoParsed = "demo_parsed"
// FieldVacPresent holds the string denoting the vac_present field in the database.
FieldVacPresent = "vac_present"
// FieldGamebanPresent holds the string denoting the gameban_present field in the database.
FieldGamebanPresent = "gameban_present"
// EdgeStats holds the string denoting the stats edge name in mutations.
EdgeStats = "stats"
// EdgePlayers holds the string denoting the players edge name in mutations.
@@ -60,6 +64,8 @@ var Columns = []string{
FieldMatchResult,
FieldMaxRounds,
FieldDemoParsed,
FieldVacPresent,
FieldGamebanPresent,
}
var (
@@ -81,4 +87,8 @@ func ValidColumn(column string) bool {
var (
// DefaultDemoParsed holds the default value on creation for the "demo_parsed" field.
DefaultDemoParsed bool
// DefaultVacPresent holds the default value on creation for the "vac_present" field.
DefaultVacPresent bool
// DefaultGamebanPresent holds the default value on creation for the "gameban_present" field.
DefaultGamebanPresent bool
)

View File

@@ -163,6 +163,20 @@ func DemoParsed(v bool) predicate.Match {
})
}
// VacPresent applies equality check predicate on the "vac_present" field. It's identical to VacPresentEQ.
func VacPresent(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldVacPresent), v))
})
}
// GamebanPresent applies equality check predicate on the "gameban_present" field. It's identical to GamebanPresentEQ.
func GamebanPresent(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldGamebanPresent), v))
})
}
// ShareCodeEQ applies the EQ predicate on the "share_code" field.
func ShareCodeEQ(v string) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
@@ -994,6 +1008,34 @@ func DemoParsedNEQ(v bool) predicate.Match {
})
}
// VacPresentEQ applies the EQ predicate on the "vac_present" field.
func VacPresentEQ(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldVacPresent), v))
})
}
// VacPresentNEQ applies the NEQ predicate on the "vac_present" field.
func VacPresentNEQ(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldVacPresent), v))
})
}
// GamebanPresentEQ applies the EQ predicate on the "gameban_present" field.
func GamebanPresentEQ(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.EQ(s.C(FieldGamebanPresent), v))
})
}
// GamebanPresentNEQ applies the NEQ predicate on the "gameban_present" field.
func GamebanPresentNEQ(v bool) predicate.Match {
return predicate.Match(func(s *sql.Selector) {
s.Where(sql.NEQ(s.C(FieldGamebanPresent), v))
})
}
// HasStats applies the HasEdge predicate on the "stats" edge.
func HasStats() predicate.Match {
return predicate.Match(func(s *sql.Selector) {