30 lines
643 B
JavaScript
30 lines
643 B
JavaScript
exports.up = async function(knex) {
|
|
await knex.schema.alterTable('users', (table) => {
|
|
table.jsonb('settings');
|
|
});
|
|
|
|
await knex.schema.alterTable('notifications', (table) => {
|
|
table.boolean('notify')
|
|
.notNullable()
|
|
.defaultTo(true);
|
|
|
|
table.boolean('email')
|
|
.notNullable()
|
|
.defaultTo(false);
|
|
|
|
table.datetime('emailed_at');
|
|
});
|
|
};
|
|
|
|
exports.down = async function(knex) {
|
|
await knex.schema.alterTable('users', (table) => {
|
|
table.dropColumn('settings');
|
|
});
|
|
|
|
await knex.schema.alterTable('notifications', (table) => {
|
|
table.dropColumn('notify');
|
|
table.dropColumn('email');
|
|
table.dropColumn('emailed_at');
|
|
});
|
|
};
|