Skip to content

Commit

Permalink
feat(backend): add migrations for grants table
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurapov committed Aug 22, 2024
1 parent c913df5 commit 27fc5aa
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
19 changes: 19 additions & 0 deletions packages/backend/migrations/20240820101148_drop_unique_grants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.alterTable('grants', function (table) {
table.dropUnique(['authServerId', 'accessType', 'accessActions'])
})
}

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.alterTable('grants', function (table) {
table.unique(['authServerId', 'accessType', 'accessActions'])
})
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.alterTable('grants', (table) => {
table.timestamp('deletedAt').nullable()
})
}

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.alterTable('grants', (table) => {
table.dropColumn('deletedAt')
})
}

0 comments on commit 27fc5aa

Please sign in to comment.