Skip to content

Commit

Permalink
fix migrator in transaction (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
goxiaoy committed Feb 23, 2022
1 parent 8149e87 commit 68a0519
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions migrator.go
Expand Up @@ -152,12 +152,12 @@ func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error) {
return err
}

defer func() {
err = rows.Close()
}()

rawColumnTypes, err := rows.ColumnTypes()

if err := rows.Close(); err != nil {
return err
}

if !m.DisableDatetimePrecision {
columnTypeSQL += ", datetime_precision "
}
Expand Down

0 comments on commit 68a0519

Please sign in to comment.