traxxx/migrations/20240904234305_content_vers...

36 lines
665 B
JavaScript

exports.up = async (knex) => {
await knex.schema.createTable('scenes_revisions', (table) => {
table.increments('id');
table.integer('scene_id')
.notNullable()
.references('id')
.inTable('releases');
table.integer('user_id')
.references('id')
.inTable('users');
table.json('base');
table.json('deltas');
table.text('comment');
table.datetime('applied_at');
table.integer('approved_by')
.references('id')
.inTable('users');
table.text('error');
table.datetime('created_at')
.notNullable()
.defaultTo(knex.fn.now());
});
};
exports.down = async (knex) => {
await knex.schema.dropTable('scenes_revisions');
};