iut-hapi/lib/migrations/4-user.js

22 lines
444 B
JavaScript
Raw Normal View History

2021-04-12 03:24:17 +00:00
'use strict';
module.exports = {
async up(knex) {
// Add the "scope" field to the "user" table
await knex.schema.table('user', (table) => {
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');
});
}
};