query store CRUD
This commit is contained in:
parent
2518a1046f
commit
7497787ae4
12 changed files with 327 additions and 5 deletions
25
src/migrations/1734187754677-queryStore.ts
Normal file
25
src/migrations/1734187754677-queryStore.ts
Normal 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");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue