Skip to content

Commit

Permalink
clickhouse: Fixed get db version query
Browse files Browse the repository at this point in the history
  • Loading branch information
chapsuk committed Feb 7, 2021
1 parent 7dd9c10 commit f752f46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func (m ClickHouseDialect) createVersionTableSQL() string {
}

func (m ClickHouseDialect) dbVersionQuery(db *sql.DB) (*sql.Rows, error) {
rows, err := db.Query(fmt.Sprintf("SELECT version_id, is_applied FROM %s ORDER BY tstamp DESC LIMIT 1", TableName()))
rows, err := db.Query(fmt.Sprintf("SELECT version_id, is_applied FROM %s ORDER BY version_id DESC", TableName()))
if err != nil {
return nil, err
}
Expand Down

0 comments on commit f752f46

Please sign in to comment.