fix: wrong table name parameter when not using default schema (#5801) · typeorm/typeorm@327144a

Original file line numberDiff line numberDiff line change

@@ -1501,7 +1501,7 @@ export class PostgresQueryRunner extends BaseQueryRunner implements QueryRunner

15011501

"type"

15021502

FROM "geometry_columns"

15031503

) AS _

1504-

WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${table.name}'`;

1504+

WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${dbTable["table_name"]}'`;

15051505
15061506

const results: ObjectLiteral[] = await this.query(geometryColumnSql);

15071507

tableColumn.spatialFeatureType = results[0].type;

@@ -1518,7 +1518,7 @@ export class PostgresQueryRunner extends BaseQueryRunner implements QueryRunner

15181518

"type"

15191519

FROM "geography_columns"

15201520

) AS _

1521-

WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${table.name}'`;

1521+

WHERE (${tablesCondition}) AND "column_name" = '${tableColumn.name}' AND "table_name" = '${dbTable["table_name"]}'`;

15221522
15231523

const results: ObjectLiteral[] = await this.query(geographyColumnSql);

15241524

tableColumn.spatialFeatureType = results[0].type;