added chat messages

This commit is contained in:
2022-01-29 19:32:13 +01:00
parent 2e6c94de81
commit b036275665
48 changed files with 4167 additions and 353 deletions

View File

@@ -85,6 +85,8 @@ const (
EdgeRoundStats = "round_stats"
// EdgeSpray holds the string denoting the spray edge name in mutations.
EdgeSpray = "spray"
// EdgeMessages holds the string denoting the messages edge name in mutations.
EdgeMessages = "messages"
// Table holds the table name of the matchplayer in the database.
Table = "match_players"
// MatchesTable is the table that holds the matches relation/edge.
@@ -122,6 +124,13 @@ const (
SprayInverseTable = "sprays"
// SprayColumn is the table column denoting the spray relation/edge.
SprayColumn = "match_player_spray"
// MessagesTable is the table that holds the messages relation/edge.
MessagesTable = "messages"
// MessagesInverseTable is the table name for the Messages entity.
// It exists in this package in order to avoid circular dependency with the "messages" package.
MessagesInverseTable = "messages"
// MessagesColumn is the table column denoting the messages relation/edge.
MessagesColumn = "match_player_messages"
)
// Columns holds all SQL columns for matchplayer fields.

View File

@@ -3182,6 +3182,34 @@ func HasSprayWith(preds ...predicate.Spray) predicate.MatchPlayer {
})
}
// HasMessages applies the HasEdge predicate on the "messages" edge.
func HasMessages() predicate.MatchPlayer {
return predicate.MatchPlayer(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(MessagesTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, MessagesTable, MessagesColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasMessagesWith applies the HasEdge predicate on the "messages" edge with a given conditions (other predicates).
func HasMessagesWith(preds ...predicate.Messages) predicate.MatchPlayer {
return predicate.MatchPlayer(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(MessagesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, MessagesTable, MessagesColumn),
)
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// And groups predicates with the AND operator between them.
func And(predicates ...predicate.MatchPlayer) predicate.MatchPlayer {
return predicate.MatchPlayer(func(s *sql.Selector) {