28 lines
623 B
Go
28 lines
623 B
Go
package schema
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// Admin holds the schema definition for the Admin entity.
|
|
type Admin struct {
|
|
ent.Schema
|
|
}
|
|
|
|
// Fields of the Admin.
|
|
func (Admin) Fields() []ent.Field {
|
|
return []ent.Field{
|
|
field.Int64("id").Unique().Immutable(),
|
|
field.String("name").Default(""),
|
|
field.String("email").Default(""),
|
|
field.String("avatar").Default(""),
|
|
field.String("access").Default(""),
|
|
field.String("password").Default(""),
|
|
field.Time("create_time").Default(time.Now).Immutable(),
|
|
field.Time("update_time").Default(time.Now).UpdateDefault(time.Now),
|
|
}
|
|
}
|