Skip to content

Commit

Permalink
clickhouse: Fixed get db version query (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
chapsuk authored Jun 18, 2022
1 parent dc83fe7 commit e8d93a0
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 @@ -302,7 +302,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 e8d93a0

Please sign in to comment.