Skip to content

Commit

Permalink
fix: foreign keys in SAP were loading from the wrong table (#7914)
Browse files Browse the repository at this point in the history
  • Loading branch information
imnotjames committed Jul 15, 2021
1 parent 444e38b commit 4777a79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/driver/sap/SapQueryRunner.ts
Expand Up @@ -1668,7 +1668,7 @@ export class SapQueryRunner extends BaseQueryRunner implements QueryRunner {
const foreignKeys = dbForeignKeys.filter(dbFk => dbFk["CONSTRAINT_NAME"] === dbForeignKey["CONSTRAINT_NAME"]);

// if referenced table located in currently used schema, we don't need to concat schema name to table name.
const schema = getSchemaFromKey(dbTable, "REFERENCED_SCHEMA_NAME");
const schema = getSchemaFromKey(dbForeignKey, "REFERENCED_SCHEMA_NAME");
const referencedTableName = this.driver.buildTableName(dbForeignKey["REFERENCED_TABLE_NAME"], schema);

return new TableForeignKey({
Expand Down

0 comments on commit 4777a79

Please sign in to comment.