forked from DebaucheryLibrarian/traxxx
42 lines
778 B
JavaScript
42 lines
778 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('data');
|
||
|
table.json('deltas');
|
||
|
|
||
|
table.text('comment');
|
||
|
|
||
|
table.boolean('approved')
|
||
|
.notNullable()
|
||
|
.defaultTo(false);
|
||
|
|
||
|
table.integer('approved_by')
|
||
|
.references('id')
|
||
|
.inTable('users');
|
||
|
|
||
|
table.boolean('applied')
|
||
|
.notNullable()
|
||
|
.defaultTo(false);
|
||
|
|
||
|
table.datetime('applied_at');
|
||
|
|
||
|
table.datetime('created_at')
|
||
|
.notNullable()
|
||
|
.defaultTo(knex.fn.now());
|
||
|
});
|
||
|
};
|
||
|
|
||
|
exports.down = async (knex) => {
|
||
|
await knex.schema.dropTable('scenes_revisions');
|
||
|
};
|