zappyzep/backend/src/migrations/1634563901575-CreatePhishermanCacheTable.ts

39 lines
954 B
TypeScript
Raw Normal View History

2021-10-31 17:17:31 +02:00
import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreatePhishermanCacheTable1634563901575 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.createTable(
new Table({
name: "phisherman_cache",
columns: [
{
name: "id",
type: "int",
isPrimary: true,
isGenerated: true,
generationStrategy: "increment",
},
{
name: "domain",
type: "varchar",
length: "255",
isUnique: true,
},
{
name: "data",
type: "text",
},
{
name: "expires_at",
type: "datetime",
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.dropTable("phisherman_cache");
}
}