Files
indee-demo/backend/src/database/migrations/1729096262567-music-videos-update.ts
Dorian 82a5c0a5cf Fix entity-based migrations that crash on missing columns
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>
2026-02-13 18:30:37 +00:00

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`,
);
}
}