From 232322d03515f81e56867ff8c765b8409399ee68 Mon Sep 17 00:00:00 2001 From: Adrien de Peretti Date: Sat, 6 Apr 2024 11:20:35 +0200 Subject: [PATCH] Chores: Do not disable foreign keys by default (#6973) --- .changeset/nice-hounds-accept.md | 5 +++++ .../utils/src/dal/mikro-orm/mikro-orm-create-connection.ts | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 .changeset/nice-hounds-accept.md diff --git a/.changeset/nice-hounds-accept.md b/.changeset/nice-hounds-accept.md new file mode 100644 index 0000000000..a49dfc576b --- /dev/null +++ b/.changeset/nice-hounds-accept.md @@ -0,0 +1,5 @@ +--- +"@medusajs/utils": patch +--- + +Chores: Do not disable foreign keys by default diff --git a/packages/utils/src/dal/mikro-orm/mikro-orm-create-connection.ts b/packages/utils/src/dal/mikro-orm/mikro-orm-create-connection.ts index 0ca55e3774..f04b80c614 100644 --- a/packages/utils/src/dal/mikro-orm/mikro-orm-create-connection.ts +++ b/packages/utils/src/dal/mikro-orm/mikro-orm-create-connection.ts @@ -110,6 +110,7 @@ export async function mikroOrmCreateConnection( type: "postgresql", filters: database.filters ?? {}, migrations: { + disableForeignKeys: false, path: pathToMigrations, generator: TSMigrationGenerator, silent: !( @@ -118,6 +119,9 @@ export async function mikroOrmCreateConnection( false ), }, + schemaGenerator: { + disableForeignKeys: false + }, pool: database.pool as any, }) }