Skip to content

Commit

Permalink
fix: return column option back (#1036)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrainsRage authored Oct 26, 2024
1 parent 3ef44ce commit a3ccbea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schema/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,10 @@ func (t *Table) newField(sf reflect.StructField, tag tagparser.Tag) *Field {
sqlName = tag.Name
}

if s, ok := tag.Option("column"); ok {
sqlName = s
}

for name := range tag.Options {
if !isKnownFieldOption(name) {
internal.Warn.Printf("%s.%s has unknown tag option: %q", t.TypeName, sf.Name, name)
Expand Down

0 comments on commit a3ccbea

Please sign in to comment.