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

27
ent/schema/messages.go Normal file
View File

@@ -0,0 +1,27 @@
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// Messages holds the schema definition for the Messages entity.
type Messages struct {
ent.Schema
}
// Fields of the Messages.
func (Messages) Fields() []ent.Field {
return []ent.Field{
field.Text("message"),
field.Bool("all_chat"),
}
}
// Edges of the Messages.
func (Messages) Edges() []ent.Edge {
return []ent.Edge{
edge.From("match_player", MatchPlayer.Type).Ref("messages").Unique(),
}
}