get protocol item

This commit is contained in:
Julian Krauser 2024-10-03 13:31:05 +02:00
parent 72fb6fbc20
commit 5c4e521bd8
10 changed files with 155 additions and 3 deletions

View file

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