added chat messages
This commit is contained in:
27
ent/schema/messages.go
Normal file
27
ent/schema/messages.go
Normal 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(),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user