Files
traxxx/migrations/20260718034747_users_settings.js
2026-07-21 04:42:30 +02:00

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');
});
};