From 8e49521dd099b839e08512b07d4e8e78970bd8ea Mon Sep 17 00:00:00 2001 From: Max Kurapov Date: Fri, 23 Aug 2024 14:12:30 +0200 Subject: [PATCH] chore(backend): merge migrations --- .../20240820101148_drop_unique_grants.js | 19 ------------------- .../20240820101201_add_deleted_at_grants.js | 2 ++ 2 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 packages/backend/migrations/20240820101148_drop_unique_grants.js diff --git a/packages/backend/migrations/20240820101148_drop_unique_grants.js b/packages/backend/migrations/20240820101148_drop_unique_grants.js deleted file mode 100644 index 90db19e050..0000000000 --- a/packages/backend/migrations/20240820101148_drop_unique_grants.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * @param { import("knex").Knex } knex - * @returns { Promise } - */ -exports.up = function (knex) { - return knex.schema.alterTable('grants', function (table) { - table.dropUnique(['authServerId', 'accessType', 'accessActions']) - }) -} - -/** - * @param { import("knex").Knex } knex - * @returns { Promise } - */ -exports.down = function (knex) { - return knex.schema.alterTable('grants', function (table) { - table.unique(['authServerId', 'accessType', 'accessActions']) - }) -} diff --git a/packages/backend/migrations/20240820101201_add_deleted_at_grants.js b/packages/backend/migrations/20240820101201_add_deleted_at_grants.js index d9e08df37e..7af33288ea 100644 --- a/packages/backend/migrations/20240820101201_add_deleted_at_grants.js +++ b/packages/backend/migrations/20240820101201_add_deleted_at_grants.js @@ -4,6 +4,7 @@ */ exports.up = function (knex) { return knex.schema.alterTable('grants', (table) => { + table.dropUnique(['authServerId', 'accessType', 'accessActions']) table.timestamp('deletedAt').nullable() }) } @@ -14,6 +15,7 @@ exports.up = function (knex) { */ exports.down = function (knex) { return knex.schema.alterTable('grants', (table) => { + table.unique(['authServerId', 'accessType', 'accessActions']) table.dropColumn('deletedAt') }) }