typeorm 0.3.11-dev.b5ff79f → 0.3.11-dev.efb4168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1451,6 +1451,9 @@ class PostgresQueryRunner extends BaseQueryRunner_1.BaseQueryRunner {
|
|
|
1451
1451
|
: table.foreignKeys.find((fk) => fk.name === foreignKeyOrName);
|
|
1452
1452
|
if (!foreignKey)
|
|
1453
1453
|
throw new error_1.TypeORMError(`Supplied foreign key was not found in table ${table.name}`);
|
|
1454
|
+
if (!foreignKey.name) {
|
|
1455
|
+
foreignKey.name = this.connection.namingStrategy.foreignKeyName(table, foreignKey.columnNames, this.getTablePath(foreignKey), foreignKey.referencedColumnNames);
|
|
1456
|
+
}
|
|
1454
1457
|
const up = this.dropForeignKeySql(table, foreignKey);
|
|
1455
1458
|
const down = this.createForeignKeySql(table, foreignKey);
|
|
1456
1459
|
await this.executeQueries(up, down);
|