Skip to content

Commit

Permalink
fix missing error-check in AutoMigrate (#5283)
Browse files Browse the repository at this point in the history
  • Loading branch information
glebarez committed Apr 22, 2022
1 parent 88c26b6 commit 395606a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion migrator/migrator.go
Expand Up @@ -99,7 +99,10 @@ func (m Migrator) AutoMigrate(values ...interface{}) error {
}
} else {
if err := m.RunWithValue(value, func(stmt *gorm.Statement) (errr error) {
columnTypes, _ := m.DB.Migrator().ColumnTypes(value)
columnTypes, err := m.DB.Migrator().ColumnTypes(value)
if err != nil {
return err
}

for _, dbName := range stmt.Schema.DBNames {
field := stmt.Schema.FieldsByDBName[dbName]
Expand Down

0 comments on commit 395606a

Please sign in to comment.