Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
demoManito committed Mar 24, 2023
1 parent f5303a6 commit 5eeda0c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion migrator/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func (m Migrator) AutoMigrate(values ...interface{}) error {
parseCheckConstraints = stmt.Schema.ParseCheckConstraints()
)
for _, dbName := range stmt.Schema.DBNames {
field := stmt.Schema.FieldsByDBName[dbName]
var foundColumn gorm.ColumnType

for _, columnType := range columnTypes {
Expand All @@ -140,6 +139,7 @@ func (m Migrator) AutoMigrate(values ...interface{}) error {
}
} else {
// found, smartly migrate
field := stmt.Schema.FieldsByDBName[dbName]
if err = execTx.Migrator().MigrateColumn(value, field, foundColumn); err != nil {
return err
}
Expand Down

0 comments on commit 5eeda0c

Please sign in to comment.