feat: workspace cache version instead of event emitter (#2637)

This commit is contained in:
Jérémy M
2023-11-22 14:51:26 +01:00
committed by GitHub
parent 85646a8072
commit 5c8c141556
15 changed files with 140 additions and 49 deletions

View File

@ -0,0 +1,14 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class AddWorkspaceCacheVersion1700650554672 implements MigrationInterface {
name = 'AddWorkspaceCacheVersion1700650554672'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "metadata"."workspaceCacheVersion" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "workspaceId" character varying NOT NULL, "version" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "UQ_1a80ecf2638b477809403cc26ed" UNIQUE ("workspaceId"), CONSTRAINT "PK_5d502f8dbfb5b9a8bf2439320e9" PRIMARY KEY ("id"))`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "metadata"."workspaceCacheVersion"`);
}
}