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
25 lines
432 B
Go
25 lines
432 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.
|
|
}
|
|
}
|