fix: code review findings
Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -15,21 +15,24 @@
|
||||
*/
|
||||
|
||||
exports.up = async function up(knex) {
|
||||
await knex.schema.createTable('notifications', table => {
|
||||
await knex.schema.createTable('notification', table => {
|
||||
table.uuid('id').primary();
|
||||
table.string('userRef').notNullable();
|
||||
table.string('user', 255).notNullable();
|
||||
table.string('title').notNullable();
|
||||
table.text('description').nullable();
|
||||
table.text('severity').notNullable();
|
||||
table.string('severity', 8).notNullable();
|
||||
table.text('link').notNullable();
|
||||
table.text('origin').notNullable();
|
||||
table.text('scope').nullable();
|
||||
table.text('topic').nullable();
|
||||
table.string('origin', 255).notNullable();
|
||||
table.string('scope', 255).nullable();
|
||||
table.string('topic', 255).nullable();
|
||||
table.datetime('created').defaultTo(knex.fn.now()).notNullable();
|
||||
table.datetime('updated').nullable();
|
||||
table.datetime('read').nullable();
|
||||
table.datetime('done').nullable();
|
||||
table.datetime('saved').nullable();
|
||||
|
||||
table.index(['user'], 'notification_user_idx');
|
||||
table.index(['scope', 'origin'], 'notification_scope_origin_idx');
|
||||
});
|
||||
};
|
||||
|
||||
@@ -37,5 +40,5 @@ exports.up = async function up(knex) {
|
||||
* @param {import('knex').Knex} knex
|
||||
*/
|
||||
exports.down = async function down(knex) {
|
||||
await knex.schema.dropTable('notifications');
|
||||
await knex.schema.dropTable('notification');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user