Files
ent/entc/integration/migrate/entv2/schema/user.go
Ariel Mashraki c203f043cf ent: add blob tyoe
Reviewed By: idoshveki

Differential Revision: D16600425

fbshipit-source-id: 04c6fe39f9b3b628a1e79eb3063188f582d9e504
2019-08-01 07:45:05 -07:00

35 lines
629 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 columns.
field.String("phone"),
field.Bytes("buffer").
Default([]byte("{}")),
// 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 }
)