From a3ccbeab39151d3eed6cb245fe15cfb5d71ba557 Mon Sep 17 00:00:00 2001 From: Dima Date: Sat, 26 Oct 2024 09:12:23 +0300 Subject: [PATCH] fix: return column option back (#1036) --- schema/table.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/schema/table.go b/schema/table.go index 79388fb1c..800063674 100644 --- a/schema/table.go +++ b/schema/table.go @@ -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)