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') }) }