Add support for hiding cases with !hidecase
This commit is contained in:
parent
ab71481b8f
commit
8de31844d5
6 changed files with 105 additions and 13 deletions
25
src/migrations/1547393619900-AddIsHiddenToCases.ts
Normal file
25
src/migrations/1547393619900-AddIsHiddenToCases.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
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,
|
||||
default: 0
|
||||
})
|
||||
);
|
||||
await queryRunner.createIndex(
|
||||
"cases",
|
||||
new TableIndex({
|
||||
columnNames: ["is_hidden"]
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<any> {
|
||||
await queryRunner.dropColumn("cases", "is_hidden");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue