From c1b4787366bd230500786a4eea9e14f5e53647b9 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sat, 21 Nov 2026 04:23:20 +0100 Subject: [PATCH] Added relation comment migration. --- ...0261121120000_scenes_relations_comments.js | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 migrations/20261121120000_scenes_relations_comments.js 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(); +};