diff --git a/src/main/migrations/1715900413313-fix_repack_uploadDate.ts b/src/main/migrations/1715900413313-fix_repack_uploadDate.ts index 0f0b8966..37048cc3 100644 --- a/src/main/migrations/1715900413313-fix_repack_uploadDate.ts +++ b/src/main/migrations/1715900413313-fix_repack_uploadDate.ts @@ -7,6 +7,16 @@ import { In, MigrationInterface, QueryRunner, Table } from "typeorm"; export class FixRepackUploadDate1715900413313 implements MigrationInterface { public async up(queryRunner: QueryRunner): Promise { + const existsTable = await queryRunner.query( + `SELECT name FROM sqlite_master WHERE type='table' AND name='repack';` + ); + + if (!existsTable.length) return; + + const repackCount = await queryRunner.manager.count(Repack); + + if (!repackCount) return; + await queryRunner.createTable( new Table({ name: "repack_temp",