Fix drop lastViewedAt migration order for fresh databases.
Run the column drop after AddUploadTable so TypeORM does not execute ALTER before uploads exists.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class DropUploadLastViewedAt1791230839247 implements MigrationInterface {
|
||||
name = 'DropUploadLastViewedAt1791230839247';
|
||||
|
||||
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`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user