Skip to content

Commit

Permalink
Merge pull request #4 from ShkrutDenis/develop
Browse files Browse the repository at this point in the history
Fix ordering migrations for select last batch
  • Loading branch information
ShkrutDenis authored Apr 9, 2020
2 parents 7816979 + 9bf9c0f commit ac56703
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion model/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func GetLastBatch(connection *sqlx.DB) int {

func GetLastMigrations(connection *sqlx.DB, lastBatch int) []*Migration {
var list []*Migration
_ = connection.Select(&list, "SELECT * FROM migrations WHERE batch=? ORDER BY created_at DESC;", lastBatch)
_ = connection.Select(&list, "SELECT * FROM migrations WHERE batch=? ORDER BY created_at DESC, id DESC;", lastBatch)
return list
}

Expand Down

0 comments on commit ac56703

Please sign in to comment.