2019-01-13 17:56:14 +02:00
|
|
|
import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from "typeorm";
|
|
|
|
|
|
|
|
export class AddIsHiddenToCases1547393619900 implements MigrationInterface {
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<any> {
|
|
|
|
await queryRunner.addColumn(
|
|
|
|
"cases",
|
|
|
|
new TableColumn({
|
|
|
|
name: "is_hidden",
|
|
|
|
type: "tinyint",
|
|
|
|
unsigned: true,
|
2019-11-02 22:11:26 +02:00
|
|
|
default: 0,
|
|
|
|
}),
|
2019-01-13 17:56:14 +02:00
|
|
|
);
|
|
|
|
await queryRunner.createIndex(
|
|
|
|
"cases",
|
|
|
|
new TableIndex({
|
2019-11-02 22:11:26 +02:00
|
|
|
columnNames: ["is_hidden"],
|
|
|
|
}),
|
2019-01-13 17:56:14 +02:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<any> {
|
|
|
|
await queryRunner.dropColumn("cases", "is_hidden");
|
|
|
|
}
|
|
|
|
}
|