Fix convertRecordPositionsToIntegers command for camelCase tables (#5315)
## Context Per title, postgresql will use lowercase if not surrounded by quotes
This commit is contained in:
@ -105,12 +105,12 @@ export class ConvertRecordPositionsToIntegers extends CommandRunner {
|
|||||||
transactionManager: any,
|
transactionManager: any,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
await this.workspaceDataSourceService.executeRawQuery(
|
await this.workspaceDataSourceService.executeRawQuery(
|
||||||
`UPDATE ${dataSourceSchema}.${tableName} SET position = subquery.position
|
`UPDATE ${dataSourceSchema}."${tableName}" SET position = subquery.position
|
||||||
FROM (
|
FROM (
|
||||||
SELECT id, ROW_NUMBER() OVER (ORDER BY position) as position
|
SELECT id, ROW_NUMBER() OVER (ORDER BY position) as position
|
||||||
FROM ${dataSourceSchema}.${tableName}
|
FROM ${dataSourceSchema}."${tableName}"
|
||||||
) as subquery
|
) as subquery
|
||||||
WHERE ${dataSourceSchema}.${tableName}.id = subquery.id`,
|
WHERE ${dataSourceSchema}."${tableName}".id = subquery.id`,
|
||||||
[],
|
[],
|
||||||
workspaceId,
|
workspaceId,
|
||||||
transactionManager,
|
transactionManager,
|
||||||
|
|||||||
Reference in New Issue
Block a user