mirror of
https://github.com/ent/ent.git
synced 2026-05-24 09:31:56 +03:00
Reviewed By: alexsn Differential Revision: D16183212 fbshipit-source-id: af288f2e1433820356e97ede77c7595db8d23a9f
21 lines
326 B
Go
21 lines
326 B
Go
package schema
|
|
|
|
import (
|
|
"fbc/ent"
|
|
"fbc/ent/field"
|
|
)
|
|
|
|
// User holds the schema definition for the User entity.
|
|
type User struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the User.
|
|
func (User) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int32("age"),
|
|
field.String("name").MaxLen(10),
|
|
field.String("address").Optional(),
|
|
}
|
|
}
|