Add new db migration

This commit is contained in:
Rubikscraft 2022-12-27 16:14:50 +01:00
parent adc58476ff
commit 5a6a366f9d
No known key found for this signature in database
GPG Key ID: 3570A2BB18A63D9F
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,16 @@
import { MigrationInterface, QueryRunner } from "typeorm";
export class V050A1672154027079 implements MigrationInterface {
name = 'V050A1672154027079'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "e_system_state_backend" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "key" character varying NOT NULL, "value" character varying NOT NULL, CONSTRAINT "UQ_f11f1605928b497b24f4b3ecc1f" UNIQUE ("key"), CONSTRAINT "PK_097ea165dadc8c14237481afd64" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE INDEX "IDX_f11f1605928b497b24f4b3ecc1" ON "e_system_state_backend" ("key") `);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "public"."IDX_f11f1605928b497b24f4b3ecc1"`);
await queryRunner.query(`DROP TABLE "e_system_state_backend"`);
}
}

View File

@ -4,6 +4,7 @@ import { V040A1662314197741 } from './1662314197741-V_0_4_0_a';
import { V040B1662485374471 } from './1662485374471-V_0_4_0_b';
import { V040C1662535484200 } from './1662535484200-V_0_4_0_c';
import { V040D1662728275448 } from './1662728275448-V_0_4_0_d';
import { V050A1672154027079 } from './1672154027079-V_0_5_0_a';
export const MigrationList: Function[] = [
V030A1661692206479,
@ -12,4 +13,5 @@ export const MigrationList: Function[] = [
V040B1662485374471,
V040C1662535484200,
V040D1662728275448,
V050A1672154027079,
];