update migrate
This commit is contained in:
@ -20,6 +20,12 @@ var cp int
|
||||
|
||||
func (Card) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
|
||||
field.String("password").
|
||||
NotEmpty().
|
||||
Immutable().
|
||||
Sensitive(),
|
||||
|
||||
field.Int("card").
|
||||
Immutable().
|
||||
DefaultFunc(func() int {
|
||||
@ -93,5 +99,6 @@ func (Card) Edges() []ent.Edge {
|
||||
Ref("card").
|
||||
Unique().
|
||||
Required(),
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,11 @@ type Group struct {
|
||||
func (Group) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.String("name"),
|
||||
|
||||
field.String("password").
|
||||
NotEmpty().
|
||||
Immutable().
|
||||
Sensitive(),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,11 @@ func (User) Fields() []ent.Field {
|
||||
//Match(regexp.MustCompile("[a-z]+$")).
|
||||
Unique(),
|
||||
|
||||
field.String("password").
|
||||
NotEmpty().
|
||||
Immutable().
|
||||
Sensitive(),
|
||||
|
||||
//field.Bool("limit").
|
||||
//Optional().
|
||||
//Default(false),
|
||||
|
Reference in New Issue
Block a user