-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rbac): backend part - store role description to the database (#1178
) * fix(rbac): store role description to the database Signed-off-by: Oleksandr Andriienko <[email protected]> * fix(rbac): fix update description when role is without changes Signed-off-by: Oleksandr Andriienko <[email protected]> * fix(rbac): add more unit tests Signed-off-by: Oleksandr Andriienko <[email protected]> * fix(rbac): fix and optimize old migration scripts Signed-off-by: Oleksandr Andriienko <[email protected]> * fix(rbac): fix unit tests and migration scripts Signed-off-by: Oleksandr Andriienko <[email protected]> * fix(rbac): fix compilation after rebase to main branch Signed-off-by: Oleksandr Andriienko <[email protected]> * fix(rbac): fix migration scripts for sqlite Signed-off-by: Oleksandr Andriienko <[email protected]> --------- Signed-off-by: Oleksandr Andriienko <[email protected]>
- Loading branch information
1 parent
b826558
commit ec8b1c2
Showing
15 changed files
with
1,442 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
plugins/rbac-backend/migrations/20240201144429_migrations.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = async function up(knex) { | ||
const isRoleMetaDataExist = await knex.schema.hasTable('role-metadata'); | ||
if (isRoleMetaDataExist) { | ||
await knex.schema.alterTable('role-metadata', table => { | ||
table.string('description'); | ||
}); | ||
} | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = async function down(knex) { | ||
const isRoleMetaDataExist = await knex.schema.hasTable('role-metadata'); | ||
if (isRoleMetaDataExist) { | ||
await knex.schema.alterTable('role-metadata', table => { | ||
table.dropColumn('description'); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.