mirror of
https://github.com/seerr-team/seerr.git
synced 2026-06-16 04:20:56 -04:00
This allows Jellyseerr to track the availability status of individual episodes, enabling better status reporting for partially available seasons.
22 lines
1.1 KiB
TypeScript
Executable File
22 lines
1.1 KiB
TypeScript
Executable File
import type { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class AddEpisodeTable1747690625482 implements MigrationInterface {
|
|
name = 'AddEpisodeTable1747690625482';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`CREATE TABLE "episode" ("id" SERIAL NOT NULL, "episodeNumber" integer NOT NULL, "status" integer NOT NULL DEFAULT '1', "status4k" integer NOT NULL DEFAULT '1', "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "seasonId" integer, CONSTRAINT "PK_7258b95d6d2bf7f621845a0e143" PRIMARY KEY ("id"))`
|
|
);
|
|
await queryRunner.query(
|
|
`ALTER TABLE "episode" ADD CONSTRAINT "FK_e73d28c1e5e3c85125163f7c9cd" FOREIGN KEY ("seasonId") REFERENCES "season"("id") ON DELETE CASCADE ON UPDATE NO ACTION`
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`ALTER TABLE "episode" DROP CONSTRAINT "FK_e73d28c1e5e3c85125163f7c9cd"`
|
|
);
|
|
await queryRunner.query(`DROP TABLE "episode"`);
|
|
}
|
|
}
|