UNPKG

@coko/server

Version:

Reusable server for use by Coko's projects

32 lines 1.15 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.down = exports.up = void 0; const up = async (knex) => { try { await knex.schema.createTable('activity_logs', table => { table.uuid('id').primary(); table .timestamp('created', { useTz: true }) .notNullable() .defaultTo(knex.fn.now()); table.timestamp('updated', { useTz: true }); table.uuid('actor_id').references('users.id').notNullable(); table.text('action_type').notNullable(); table.jsonb('value_before'); table.jsonb('value_after'); table.jsonb('affected_objects').defaultTo([]); table.text('message'); table.jsonb('additional_data'); table.text('type').notNullable(); }); } catch (e) { throw new Error(`Acitivity log: Initial: Migration failed! ${e}`); } }; exports.up = up; const down = async (knex) => { await knex.schema.dropTable('activity_logs'); }; exports.down = down; //# sourceMappingURL=1696505906-activityLog-init.js.map