fix migrate migrationDidRun bug on postgres
This commit is contained in:
parent
5185fdfa1b
commit
abd3221470
|
@ -194,9 +194,7 @@ func (m *Migrate) createMigrationTableIfNotExists() error {
|
|||
}
|
||||
|
||||
func (m *Migrate) migrationDidRun(mig *Migration) bool {
|
||||
row := m.db.DB().QueryRow(fmt.Sprintf("SELECT COUNT(*) FROM %s WHERE %s = ?", m.options.TableName, m.options.IDColumnName), mig.ID)
|
||||
var count int
|
||||
row.Scan(&count)
|
||||
count, err := m.db.SQL(fmt.Sprintf("SELECT COUNT(*) FROM %s WHERE %s = ?", m.options.TableName, m.options.IDColumnName), mig.ID).Count()
|
||||
return count > 0
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue