24 lines
577 B
JavaScript
24 lines
577 B
JavaScript
'use strict';
|
|
|
|
module.exports = {
|
|
|
|
async up(knex) {
|
|
|
|
// Add the "scope" field to the "user" table
|
|
await knex.schema.table('user', (table) => {
|
|
table.dropColumn('scope'); // Remove the "role" field
|
|
table.string('scope').notNullable().defaultTo('user');
|
|
|
|
});
|
|
},
|
|
|
|
async down(knex) {
|
|
|
|
// Revert the changes made in the "up" function
|
|
await knex.schema.table('user', (table) => {
|
|
table.dropColumn('scope');
|
|
table.string('scope').notNullable().defaultTo('user');
|
|
});
|
|
}
|
|
};
|