We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e1c9fd commit efb4168Copy full SHA for efb4168
src/driver/postgres/PostgresQueryRunner.ts
@@ -2874,6 +2874,15 @@ export class PostgresQueryRunner
2874
`Supplied foreign key was not found in table ${table.name}`,
2875
)
2876
2877
+ if (!foreignKey.name) {
2878
+ foreignKey.name = this.connection.namingStrategy.foreignKeyName(
2879
+ table,
2880
+ foreignKey.columnNames,
2881
+ this.getTablePath(foreignKey),
2882
+ foreignKey.referencedColumnNames,
2883
+ )
2884
+ }
2885
+
2886
const up = this.dropForeignKeySql(table, foreignKey)
2887
const down = this.createForeignKeySql(table, foreignKey)
2888
await this.executeQueries(up, down)
0 commit comments