-
Notifications
You must be signed in to change notification settings - Fork 0
/
skill.go
47 lines (41 loc) · 821 Bytes
/
skill.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package schema
import (
"entgo.io/contrib/entgql"
"entgo.io/contrib/entproto"
"entgo.io/ent"
"entgo.io/ent/schema"
"entgo.io/ent/schema/edge"
"entgo.io/ent/schema/field"
)
// Skill holds the schema definition for the Skill entity.
type Skill struct {
ent.Schema
}
func (Skill) Mixin() []ent.Mixin {
return []ent.Mixin{
CommonMixin{},
}
}
// Fields of the Skill.
func (Skill) Fields() []ent.Field {
return []ent.Field{
field.Strings("desc").Annotations(
entproto.Field(4),
),
}
}
// Edges of the Skill.
func (Skill) Edges() []ent.Edge {
return []ent.Edge{
edge.To("ability_score", AbilityScore.Type).
Unique().Annotations(
entproto.Field(5),
),
}
}
// Annotations of the Skill.
func (Skill) Annotations() []schema.Annotation {
return []schema.Annotation{
entgql.QueryField(),
}
}