mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 12:25:02 +00:00
feat: timeout support
This commit is contained in:
parent
06877e90cc
commit
39e0dfa27f
23 changed files with 532 additions and 92 deletions
|
@ -0,0 +1,44 @@
|
|||
import { MigrationInterface, QueryRunner, TableColumn, TableIndex } from "typeorm";
|
||||
|
||||
export class AddTimeoutColumnsToMutes1680354053183 implements MigrationInterface {
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.addColumns("mutes", [
|
||||
new TableColumn({
|
||||
name: "type",
|
||||
type: "tinyint",
|
||||
unsigned: true,
|
||||
default: 1, // The value for "Role" mute at the time of this migration
|
||||
}),
|
||||
new TableColumn({
|
||||
name: "mute_role",
|
||||
type: "bigint",
|
||||
unsigned: true,
|
||||
isNullable: true,
|
||||
default: null,
|
||||
}),
|
||||
new TableColumn({
|
||||
name: "timeout_expires_at",
|
||||
type: "datetime",
|
||||
isNullable: true,
|
||||
default: null,
|
||||
}),
|
||||
]);
|
||||
await queryRunner.createIndex(
|
||||
"mutes",
|
||||
new TableIndex({
|
||||
columnNames: ["type"],
|
||||
}),
|
||||
);
|
||||
await queryRunner.createIndex(
|
||||
"mutes",
|
||||
new TableIndex({
|
||||
columnNames: ["timeout_expires_at"],
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.dropColumn("mutes", "type");
|
||||
await queryRunner.dropColumn("mutes", "mute_role");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue