We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5303a6 commit 5eeda0cCopy full SHA for 5eeda0c
migrator/migrator.go
@@ -123,7 +123,6 @@ func (m Migrator) AutoMigrate(values ...interface{}) error {
123
parseCheckConstraints = stmt.Schema.ParseCheckConstraints()
124
)
125
for _, dbName := range stmt.Schema.DBNames {
126
- field := stmt.Schema.FieldsByDBName[dbName]
127
var foundColumn gorm.ColumnType
128
129
for _, columnType := range columnTypes {
@@ -140,6 +139,7 @@ func (m Migrator) AutoMigrate(values ...interface{}) error {
140
139
}
141
} else {
142
// found, smartly migrate
+ field := stmt.Schema.FieldsByDBName[dbName]
143
if err = execTx.Migrator().MigrateColumn(value, field, foundColumn); err != nil {
144
return err
145
0 commit comments