From 2aca96d1474967da11bac81a58db9c97bd7bdcac Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 5 May 2021 08:26:15 +0800 Subject: [PATCH] test ignore migration, close #4314, #4315 --- schema/field_test.go | 2 ++ 1 file changed, 2 insertions(+) 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 {