mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Reviewed By: alexsn Differential Revision: D16884402 fbshipit-source-id: 216bbf875251b0cbdd61e312ad763b439cab7813
30 lines
395 B
Go
30 lines
395 B
Go
package base
|
|
|
|
import (
|
|
"fbc/ent"
|
|
"fbc/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"),
|
|
)
|
|
}
|