From cb8a6a800d0e5ed2a5449086f7d77ed4767d95da Mon Sep 17 00:00:00 2001 From: nobswebdev Date: Tue, 27 Oct 2026 14:55:27 +0100 Subject: [PATCH] Drop lastViewedAt from uploads because inactivity cleanup is out of scope. Add a migration and remove the column from the Upload entity. --- .../1761582000000-drop-upload-last-viewed-at.ts | 13 +++++++++++++ backend/src/modules/upload/entities/Upload.ts | 3 --- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 backend/src/database/migrations/1761582000000-drop-upload-last-viewed-at.ts diff --git a/backend/src/database/migrations/1761582000000-drop-upload-last-viewed-at.ts b/backend/src/database/migrations/1761582000000-drop-upload-last-viewed-at.ts new file mode 100644 index 0000000..c938614 --- /dev/null +++ b/backend/src/database/migrations/1761582000000-drop-upload-last-viewed-at.ts @@ -0,0 +1,13 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class DropUploadLastViewedAt1761582000000 implements MigrationInterface { + name = 'DropUploadLastViewedAt1761582000000'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "uploads" DROP COLUMN "lastViewedAt"`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE "uploads" ADD "lastViewedAt" TIMESTAMP WITH TIME ZONE`); + } +} diff --git a/backend/src/modules/upload/entities/Upload.ts b/backend/src/modules/upload/entities/Upload.ts index 45807e1..0d59e24 100644 --- a/backend/src/modules/upload/entities/Upload.ts +++ b/backend/src/modules/upload/entities/Upload.ts @@ -32,9 +32,6 @@ export class Upload { @OneToOne(() => UploadHotlink, hotlink => hotlink.upload, { cascade: true }) hotlink: UploadHotlink | null; - @Column({ type: 'timestamptz', nullable: true }) - lastViewedAt: Date | null; - @Column({ type: 'timestamptz', nullable: true }) expiresAt: Date | null;