Add tempbans (#139)

This commit is contained in:
Nils 2021-01-28 00:20:55 +01:00 committed by GitHub
parent d8e721c9de
commit a7e01ae4e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 372 additions and 37 deletions

View file

@ -0,0 +1,45 @@
import { MigrationInterface, QueryRunner, Table, TableIndex } from "typeorm";
export class CreateTempBansTable1608753440716 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
const table = await queryRunner.createTable(
new Table({
name: "tempbans",
columns: [
{
name: "guild_id",
type: "bigint",
isPrimary: true,
},
{
name: "user_id",
type: "bigint",
isPrimary: true,
},
{
name: "mod_id",
type: "bigint",
},
{
name: "created_at",
type: "datetime",
},
{
name: "expires_at",
type: "datetime",
},
],
}),
);
queryRunner.createIndex(
"tempbans",
new TableIndex({
columnNames: ["expires_at"],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropTable("tempbans");
}
}