From 551393aa4eafecdca4f3fdbbc7765e0391ef5d8d Mon Sep 17 00:00:00 2001 From: Mitt <10653144+MittWillson@users.noreply.github.com> Date: Tue, 28 Sep 2021 10:35:07 +0800 Subject: [PATCH] feat: add ignoreMigration support for ParseField --- schema/field.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schema/field.go b/schema/field.go index ce0e3c130..8cca57881 100644 --- a/schema/field.go +++ b/schema/field.go @@ -189,6 +189,10 @@ func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field { field.Comment = val } + if _, ok := field.TagSettings["IGNOREMIGRATION"]; ok { + field.IgnoreMigration = true + } + // default value is function or null or blank (primary keys) field.DefaultValue = strings.TrimSpace(field.DefaultValue) skipParseDefaultValue := strings.Contains(field.DefaultValue, "(") &&