Skip to content

Commit

Permalink
feat: add ignoreMigration support for ParseField
Browse files Browse the repository at this point in the history
  • Loading branch information
mittwillson committed Sep 28, 2021
1 parent 4542b9b commit 551393a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schema/field.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "(") &&
Expand Down

0 comments on commit 551393a

Please # to comment.