Files
ent/entc/load/testdata/base/schema.go
Ariel Mashraki e0e754717e ent: change ent package name (#1338)
Summary:
Pull Request resolved: https://github.com/facebookexternal/fbc/pull/1338

Pull Request resolved: https://github.com/facebookincubator/ent/pull/14

Reviewed By: alexsn

Differential Revision: D16890825

fbshipit-source-id: 656baaa73f5debab08c849b6b9639caeec2a8ef1
2019-08-19 09:32:14 -07:00

30 lines
445 B
Go

package base
import (
"github.com/facebookincubator/ent"
"github.com/facebookincubator/ent/schema/field"
)
// base schema for sharing fields and edges.
type base struct {
ent.Schema
}
func (base) Fields() []ent.Field {
return []ent.Field{
field.Int("base_field"),
}
}
// User holds the user schema.
type User struct {
base
}
func (u User) Fields() []ent.Field {
return append(
u.base.Fields(),
field.String("user_field"),
)
}