mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Reviewed By: alexsn Differential Revision: D16763332 fbshipit-source-id: e3e4279c62992de192464c3d3b1036c45687507c
42 lines
570 B
Go
42 lines
570 B
Go
package valid
|
|
|
|
import (
|
|
"fbc/ent"
|
|
"fbc/ent/schema/field"
|
|
)
|
|
|
|
// User holds the user schema.
|
|
type User struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (User) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int("age"),
|
|
field.String("name"),
|
|
}
|
|
}
|
|
|
|
// Group holds the group schema.
|
|
type Group struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (Group) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Time("expired_at"),
|
|
field.String("organization"),
|
|
}
|
|
}
|
|
|
|
// Tag holds the tag schema.
|
|
type Tag struct {
|
|
ent.Schema
|
|
}
|
|
|
|
func (Tag) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.String("text"),
|
|
}
|
|
}
|