Skip to content

Commit

Permalink
fix: deletedAt not set for offline assets during 1.116.0 migration (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
zackpollard authored Oct 1, 2024
1 parent 67aa124 commit 3b96870
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions server/src/migrations/1727781844613-IsOfflineSetDeletedAt.ts
Original file line number Diff line number Diff line change
@@ -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`,
);
}
}

0 comments on commit 3b96870

Please sign in to comment.