mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Summary: Go plugin is not a good solution for both internal and external usage. It's hard to manage and maintain matching versions (both Go and external libraries), and it does not support Windows. Reviewed By: alexsn Differential Revision: D16582217 fbshipit-source-id: 81876d2c6f30bbfc16ecf9e5000f0670f2e62484
42 lines
563 B
Go
42 lines
563 B
Go
package valid
|
|
|
|
import (
|
|
"fbc/ent"
|
|
"fbc/ent/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"),
|
|
}
|
|
}
|