zappyzep/backend/src/migrations/1580038836906-CreateAntiraidLevelsTable.ts
Dragory 84135b201b
Add anti-raid levels to automod. Large refactor of spam detection. Add member_join and member_join_spam triggers.
Anti-raid levels don't by themselves do anything, but they can be
used in overrides to activate specific automod items.

Spam detection should now be more reliable and also combine further
spam messages after the initial detection into the archive.

Messages deleted by automod no longer create the normal deletion log
entry. Instead, the AUTOMOD_ACTION log entry contains the deleted
message or an archive if there are multiple (i.e. spam).
2020-01-26 19:54:32 +02:00

28 lines
716 B
TypeScript

import { MigrationInterface, QueryRunner, Table } from "typeorm";
export class CreateAntiraidLevelsTable1580038836906 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.createTable(
new Table({
name: "antiraid_levels",
columns: [
{
name: "guild_id",
type: "bigint",
unsigned: true,
isPrimary: true,
},
{
name: "level",
type: "varchar",
length: "64",
},
],
}),
);
}
public async down(queryRunner: QueryRunner): Promise<any> {
await queryRunner.dropTable("antiraid_levels");
}
}