Files
ent/entc/integration/migrate/entv2/schema/user.go
Ariel Mashraki b5cdb810b8 dialect/sql/schema: universl id allocation support
Summary: Pull Request resolved: https://github.com/facebookincubator/ent/pull/9

Reviewed By: alexsn

Differential Revision: D16252229

fbshipit-source-id: 795b6556d322e5c1ff5fb826c3b06ba5421ac857
2019-07-15 02:30:41 -07:00

33 lines
577 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{
// changing the type of the field.
field.Int("age"),
// extending name field to longtext.
field.Text("name"),
// adding new column.
field.String("phone"),
// deleting the address column.
}
}
// Additional types to be added to the schema.
type (
// Pet schema.
Pet struct{ ent.Schema }
// Group schema.
Group struct{ ent.Schema }
)