query store CRUD

This commit is contained in:
Julian Krauser 2024-12-14 16:11:53 +01:00
parent 2518a1046f
commit 7497787ae4
12 changed files with 327 additions and 5 deletions

View file

@ -0,0 +1,25 @@
import { MigrationInterface, QueryRunner, Table } from "typeorm";
import { DB_TYPE } from "../env.defaults";
export class QueryStore1734187754677 implements MigrationInterface {
name = "QueryStore1734187754677";
public async up(queryRunner: QueryRunner): Promise<void> {
const variableType_int = DB_TYPE == "mysql" ? "int" : "integer";
await queryRunner.createTable(
new Table({
name: "query",
columns: [
{ name: "id", type: variableType_int, isPrimary: true, isGenerated: true, generationStrategy: "increment" },
{ name: "query", type: "text", isNullable: false, default: "''" },
],
}),
true
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("query");
}
}