Skip to content

Commit

Permalink
fix: wrong table name parameter when not using default schema (#5801)
Browse files Browse the repository at this point in the history
* Fix wrong table name parameter when not using default schema

* Fix linting issue

Co-authored-by: Igor Aguiar Rodrigues <igor@devix.co>
  • Loading branch information
igoraguiar and Igor Aguiar Rodrigues committed May 16, 2020
1 parent 416e419 commit 327144a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/driver/postgres/PostgresQueryRunner.ts
Expand Up @@ -1501,7 +1501,7 @@ export class PostgresQueryRunner extends BaseQueryRunner implements QueryRunner
"type"
FROM "geometry_columns"
) AS _
WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${table.name}'`;
WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${dbTable["table_name"]}'`;

const results: ObjectLiteral[] = await this.query(geometryColumnSql);
tableColumn.spatialFeatureType = results[0].type;
Expand All @@ -1518,7 +1518,7 @@ export class PostgresQueryRunner extends BaseQueryRunner implements QueryRunner
"type"
FROM "geography_columns"
) AS _
WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${table.name}'`;
WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${dbTable["table_name"]}'`;

const results: ObjectLiteral[] = await this.query(geographyColumnSql);
tableColumn.spatialFeatureType = results[0].type;
Expand Down

0 comments on commit 327144a

Please sign in to comment.