29 lines
529 B
Go
29 lines
529 B
Go
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"),
|
|
field.Int("tick"),
|
|
}
|
|
}
|
|
|
|
// Edges of the Messages.
|
|
func (Messages) Edges() []ent.Edge {
|
|
return []ent.Edge{
|
|
edge.From("match_player", MatchPlayer.Type).Ref("messages").Unique(),
|
|
}
|
|
}
|