Skip to content

Commit

Permalink
Fix convertRecordPositionsToIntegers command for camelCase tables (tw…
Browse files Browse the repository at this point in the history
…entyhq#5315)

## Context
Per title, postgresql will use lowercase if not surrounded by quotes
  • Loading branch information
Weiko authored May 7, 2024
1 parent 96e61ab commit 8e96e0c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,12 @@ export class ConvertRecordPositionsToIntegers extends CommandRunner {
transactionManager: any,
): Promise<void> {
await this.workspaceDataSourceService.executeRawQuery(
`UPDATE ${dataSourceSchema}.${tableName} SET position = subquery.position
`UPDATE ${dataSourceSchema}."${tableName}" SET position = subquery.position
FROM (
SELECT id, ROW_NUMBER() OVER (ORDER BY position) as position
FROM ${dataSourceSchema}.${tableName}
FROM ${dataSourceSchema}."${tableName}"
) as subquery
WHERE ${dataSourceSchema}.${tableName}.id = subquery.id`,
WHERE ${dataSourceSchema}."${tableName}".id = subquery.id`,
[],
workspaceId,
transactionManager,
Expand Down

0 comments on commit 8e96e0c

Please sign in to comment.