Skip to content

Commit eef9d3b

Browse files
authored
Merge pull request #173 from zzet/patch-1
fix: Quote `id` column as it described in dialect definition
2 parents 435005d + dd1b571 commit eef9d3b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

migrate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ func (ms MigrationSet) GetMigrationRecords(db *sql.DB, dialect string) ([]*Migra
707707
}
708708

709709
var records []*MigrationRecord
710-
query := fmt.Sprintf("SELECT * FROM %s ORDER BY id ASC", dbMap.Dialect.QuotedTableForQuery(ms.SchemaName, ms.getTableName()))
710+
query := fmt.Sprintf("SELECT * FROM %s ORDER BY %s ASC", dbMap.Dialect.QuotedTableForQuery(ms.SchemaName, ms.getTableName()), dbMap.Dialect.QuoteField("id"))
711711
_, err = dbMap.Select(&records, query)
712712
if err != nil {
713713
return nil, err

0 commit comments

Comments
 (0)