diff --git a/migrations/20261121120000_scenes_relations_comments.js b/migrations/20261121120000_scenes_relations_comments.js new file mode 100644 index 00000000..7a29b120 --- /dev/null +++ b/migrations/20261121120000_scenes_relations_comments.js @@ -0,0 +1,22 @@ +exports.up = async function(knex) { + await knex('relations_types').insert({ type: 'reedit' }); // a rerelease that was significantly altered, a remaster implies improvement rather than reimagining + + await knex.schema.alterTable('scenes_relations', (table) => { + // clarify how the scene was transformed, so the closest type can be picked instead of needing a type for every variation + table.text('comment'); + }); +}; + +exports.down = async function(knex) { + await knex.schema.alterTable('scenes_relations', (table) => { + table.dropColumn('comment'); + }); + + await knex('scenes_relations') + .where('type', 'reedit') + .delete(); + + await knex('relations_types') + .where('type', 'reedit') + .delete(); +};