Drop lastViewedAt from uploads because inactivity cleanup is out of scope.
Add a migration and remove the column from the Upload entity.
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||||
|
|
||||||
|
export class DropUploadLastViewedAt1761582000000 implements MigrationInterface {
|
||||||
|
name = 'DropUploadLastViewedAt1761582000000';
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE "uploads" DROP COLUMN "lastViewedAt"`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE "uploads" ADD "lastViewedAt" TIMESTAMP WITH TIME ZONE`);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,9 +32,6 @@ export class Upload {
|
|||||||
@OneToOne(() => UploadHotlink, hotlink => hotlink.upload, { cascade: true })
|
@OneToOne(() => UploadHotlink, hotlink => hotlink.upload, { cascade: true })
|
||||||
hotlink: UploadHotlink | null;
|
hotlink: UploadHotlink | null;
|
||||||
|
|
||||||
@Column({ type: 'timestamptz', nullable: true })
|
|
||||||
lastViewedAt: Date | null;
|
|
||||||
|
|
||||||
@Column({ type: 'timestamptz', nullable: true })
|
@Column({ type: 'timestamptz', nullable: true })
|
||||||
expiresAt: Date | null;
|
expiresAt: Date | null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user