Skip to content

Commit

Permalink
fix ListMigrations query for YDB
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Jan 26, 2024
1 parent 1b23a2d commit 4afc7cd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions internal/dialect/dialectquery/ydb.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ func (c *Ydb) GetMigrationByVersion(tableName string) string {
}

func (c *Ydb) ListMigrations(tableName string) string {
// "--!syntax_pg" enables query processing with PostgreSQL-compatible syntax.
// YQL by design strictly forbids the execution of SELECT statements without columns from ORDER BY clause.
// In PostgreSQL-compatible mode, SELECT statements can be processed without columns from ORDER BY clause.
q := `--!syntax_pg
SELECT version_id, is_applied FROM %s ORDER BY tstamp DESC`
q := `SELECT version_id, is_applied FROM %s ORDER BY version_id DESC`
return fmt.Sprintf(q, tableName)
}

0 comments on commit 4afc7cd

Please sign in to comment.