1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

fix(server): remove thumbnailAt in asset_job_status for missing thumbnails (#12254)

* Remove thumbnailAt in asset_job_status for missing thumbnails

* fix linter error
This commit is contained in:
PyKen 2024-09-03 13:19:15 +09:00 committed by GitHub
parent 7c978571e0
commit 4af8433aad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -0,0 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class RemoveThumbailAtForMissingThumbnails1725327902980 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`UPDATE "asset_job_status" j SET "thumbnailAt" = NULL WHERE j."thumbnailAt" IS NOT NULL AND NOT EXISTS ( SELECT 1 FROM public.asset_files f WHERE j."assetId" = f."assetId" AND f."type" = 'thumbnail' AND f."path" IS NOT NULL )`);
}
public async down(): Promise<void> {
// do nothing
}
}