From b3096c477ace9f114c1c2dc721a9966b8e012e17 Mon Sep 17 00:00:00 2001 From: bsanduc Date: Tue, 27 Aug 2024 17:12:41 +0300 Subject: [PATCH] Remove cascade deletion --- ...40827131417_update_grants_with_tenantId.js | 6 +--- ...27115832_update_resources_with_tenantId.js | 30 ++++--------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/packages/auth/migrations/20240827131417_update_grants_with_tenantId.js b/packages/auth/migrations/20240827131417_update_grants_with_tenantId.js index 758d187419..98ca85fbe7 100644 --- a/packages/auth/migrations/20240827131417_update_grants_with_tenantId.js +++ b/packages/auth/migrations/20240827131417_update_grants_with_tenantId.js @@ -5,11 +5,7 @@ exports.up = function (knex) { return knex.schema.table('grants', function (table) { table.uuid('tenantId').notNullable() - table - .foreign('tenantId') - .references('id') - .inTable('tenants') - .onDelete('CASCADE') + table.foreign('tenantId').references('id').inTable('tenants') }) } diff --git a/packages/backend/migrations/20240827115832_update_resources_with_tenantId.js b/packages/backend/migrations/20240827115832_update_resources_with_tenantId.js index aa1adde645..6d9f201a57 100644 --- a/packages/backend/migrations/20240827115832_update_resources_with_tenantId.js +++ b/packages/backend/migrations/20240827115832_update_resources_with_tenantId.js @@ -6,43 +6,23 @@ exports.up = function (knex) { return knex.schema .table('quotes', function (table) { table.uuid('tenantId').notNullable() - table - .foreign('tenantId') - .references('id') - .inTable('tenants') - .onDelete('CASCADE') + table.foreign('tenantId').references('id').inTable('tenants') }) .table('incomingPayments', function (table) { table.uuid('tenantId').notNullable() - table - .foreign('tenantId') - .references('id') - .inTable('tenants') - .onDelete('CASCADE') + table.foreign('tenantId').references('id').inTable('tenants') }) .table('outgoingPayments', function (table) { table.uuid('tenantId').notNullable() - table - .foreign('tenantId') - .references('id') - .inTable('tenants') - .onDelete('CASCADE') + table.foreign('tenantId').references('id').inTable('tenants') }) .table('walletAddresses', function (table) { table.uuid('tenantId').notNullable() - table - .foreign('tenantId') - .references('id') - .inTable('tenants') - .onDelete('CASCADE') + table.foreign('tenantId').references('id').inTable('tenants') }) .table('grants', function (table) { table.uuid('tenantId').notNullable() - table - .foreign('tenantId') - .references('id') - .inTable('tenants') - .onDelete('CASCADE') + table.foreign('tenantId').references('id').inTable('tenants') }) }