MusicVideosUpdate and AddEpisodicGenres migrations used TypeORM entity classes which reference columns that don't exist at their migration timestamp (e.g. trailer_old, later entity fields). Rewrote both to use raw SQL INSERT/UPDATE statements. Also bumped CACHEBUST to v3 to force backend image rebuild. Co-authored-by: Cursor <cursoragent@cursor.com>
18 lines
856 B
TypeScript
18 lines
856 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class MusicVideosUpdate1729096262567 implements MigrationInterface {
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
// 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<void> {
|
|
// 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`,
|
|
);
|
|
}
|
|
}
|