forked from DebaucheryLibrarian/traxxx
Added rudimentary notifications for set alerts.
This commit is contained in:
@@ -1241,6 +1241,33 @@ exports.up = knex => Promise.resolve()
|
||||
|
||||
table.unique(['alert_id', 'stash_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('notifications', (table) => {
|
||||
table.increments('id');
|
||||
|
||||
table.integer('user_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('users')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('scene_id')
|
||||
.references('id')
|
||||
.inTable('releases')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.integer('alert_id')
|
||||
.references('id')
|
||||
.inTable('alerts')
|
||||
.onDelete('set null');
|
||||
|
||||
table.boolean('seen')
|
||||
.notNullable()
|
||||
.defaultTo(false);
|
||||
|
||||
table.datetime('created_at')
|
||||
.notNullable()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
// SEARCH
|
||||
.then(() => { // eslint-disable-line arrow-body-style
|
||||
// allow vim fold
|
||||
@@ -1631,6 +1658,8 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
||||
DROP TABLE IF EXISTS entities_types CASCADE;
|
||||
DROP TABLE IF EXISTS entities CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS notifications CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS stashes_scenes CASCADE;
|
||||
DROP TABLE IF EXISTS stashes_movies CASCADE;
|
||||
DROP TABLE IF EXISTS stashes_actors CASCADE;
|
||||
|
||||
Reference in New Issue
Block a user