mirror of
https://github.com/immich-app/immich.git
synced 2024-12-29 15:11:58 +00:00
fix: deletedAt not set for offline assets during 1.116.0 migration (#13086)
This commit is contained in:
parent
67aa124de9
commit
3b968707a7
1 changed files with 16 additions and 0 deletions
16
server/src/migrations/1727781844613-IsOfflineSetDeletedAt.ts
Normal file
16
server/src/migrations/1727781844613-IsOfflineSetDeletedAt.ts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class IsOfflineSetDeletedAt1727781844613 implements MigrationInterface {
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`UPDATE assets SET "deletedAt" = now() WHERE "isOffline" = true AND "deletedAt" IS NULL`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(
|
||||||
|
`UPDATE assets SET "deletedAt" = null WHERE "isOffline" = true`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue