feat: make role name unique and remove key usage

This commit is contained in:
Ali BARIN
2024-09-04 11:07:45 +00:00
parent b089069b8e
commit 63dfb6947e
33 changed files with 51 additions and 55 deletions

View File

@@ -1,11 +1,11 @@
export async function up(knex) {
return await knex.schema.alterTable('roles', (table) => {
table.unique('key');
table.unique('name');
});
}
export async function down(knex) {
return await knex.schema.alterTable('roles', function (table) {
table.dropUnique('key');
table.dropUnique('name');
});
}

View File

@@ -0,0 +1,11 @@
export async function up(knex) {
return await knex.schema.alterTable('roles', (table) => {
table.dropColumn('key');
});
}
export async function down(knex) {
return await knex.schema.alterTable('roles', function (table) {
table.string('key').notNullable();
});
}