Added email columns to users and notifications table.
This commit is contained in:
29
migrations/20260718034747_users_settings.js
Normal file
29
migrations/20260718034747_users_settings.js
Normal file
@@ -0,0 +1,29 @@
|
||||
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');
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user