import { MigrationInterface, QueryRunner } from 'typeorm'; export class MusicVideosUpdate1729096262567 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { // Update all projects with category 'music-video' to category 'narrative' + type 'music-video' await queryRunner.query( `UPDATE "projects" SET "category" = 'narrative', "type" = 'music-video' WHERE "category" = 'music-video' AND "deleted_at" IS NULL`, ); } public async down(queryRunner: QueryRunner): Promise { // Revert: projects with category 'narrative' and type 'music-video' back to category 'music-video', type 'film' await queryRunner.query( `UPDATE "projects" SET "category" = 'music-video', "type" = 'film' WHERE "category" = 'narrative' AND "type" = 'music-video' AND "deleted_at" IS NULL`, ); } }