diff --git a/schema/field_test.go b/schema/field_test.go index 64f4a909..00f8cd42 100644 --- a/schema/field_test.go +++ b/schema/field_test.go @@ -235,6 +235,7 @@ type UserWithPermissionControl struct { Name5 string `gorm:"<-:update"` Name6 string `gorm:"<-:create,update"` Name7 string `gorm:"->:false;<-:create,update"` + Name8 string `gorm:"->;-:migration"` } func TestParseFieldWithPermission(t *testing.T) { @@ -252,6 +253,7 @@ func TestParseFieldWithPermission(t *testing.T) { {Name: "Name5", DBName: "name5", BindNames: []string{"Name5"}, DataType: schema.String, Tag: `gorm:"<-:update"`, Creatable: false, Updatable: true, Readable: true}, {Name: "Name6", DBName: "name6", BindNames: []string{"Name6"}, DataType: schema.String, Tag: `gorm:"<-:create,update"`, Creatable: true, Updatable: true, Readable: true}, {Name: "Name7", DBName: "name7", BindNames: []string{"Name7"}, DataType: schema.String, Tag: `gorm:"->:false;<-:create,update"`, Creatable: true, Updatable: true, Readable: false}, + {Name: "Name8", DBName: "name8", BindNames: []string{"Name8"}, DataType: schema.String, Tag: `gorm:"<->"`, Creatable: false, Updatable: false, Readable: true, IgnoreMigration: true}, } for _, f := range fields {