2021-01-06 02:35:46 +01:00
import type { MigrationInterface , QueryRunner } from 'typeorm' ;
2020-04-22 01:59:20 +02:00
export class initialMigration1587511036078 implements MigrationInterface {
name = 'initialMigration1587511036078' ;
public async up ( queryRunner : QueryRunner ) : Promise < void > {
await queryRunner . query (
` CREATE TABLE "store_value" ("key" varchar PRIMARY KEY NOT NULL, "value" text NOT NULL) ` ,
2021-01-30 22:34:36 +01:00
undefined ,
2020-04-22 01:59:20 +02:00
) ;
await queryRunner . query (
` CREATE TABLE "query-result-cache" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "identifier" varchar, "time" bigint NOT NULL, "duration" integer NOT NULL, "query" text NOT NULL, "result" text NOT NULL) ` ,
2021-01-30 22:34:36 +01:00
undefined ,
2020-04-22 01:59:20 +02:00
) ;
}
public async down ( queryRunner : QueryRunner ) : Promise < void > {
await queryRunner . query ( ` DROP TABLE "query-result-cache" ` , undefined ) ;
await queryRunner . query ( ` DROP TABLE "store_value" ` , undefined ) ;
}
}