From 8769c7625cafd14e6f304601cc99a195e833d38b Mon Sep 17 00:00:00 2001 From: TheArcaneBrony Date: Sat, 13 Aug 2022 17:16:23 +0200 Subject: Fix config table, add plugin events, implement onPreMessageEvent, add http error data field, migrations --- .../mariadb/1660404644371-PluginConfigs.ts | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/util/migrations/mariadb/1660404644371-PluginConfigs.ts (limited to 'src/util/migrations/mariadb/1660404644371-PluginConfigs.ts') diff --git a/src/util/migrations/mariadb/1660404644371-PluginConfigs.ts b/src/util/migrations/mariadb/1660404644371-PluginConfigs.ts new file mode 100644 index 00000000..73953ca8 --- /dev/null +++ b/src/util/migrations/mariadb/1660404644371-PluginConfigs.ts @@ -0,0 +1,42 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class PluginConfigs1660404644371 implements MigrationInterface { + name = 'PluginConfigs1660404644371' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + DROP INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\` + `); + await queryRunner.query(` + CREATE TABLE \`plugin_config\` ( + \`key\` varchar(255) NOT NULL, + \`value\` text NULL, + PRIMARY KEY (\`key\`) + ) ENGINE = InnoDB + `); + await queryRunner.query(` + ALTER TABLE \`channels\` + ADD \`flags\` int NULL + `); + await queryRunner.query(` + ALTER TABLE \`channels\` + ADD \`default_thread_rate_limit_per_user\` int NULL + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE \`channels\` DROP COLUMN \`default_thread_rate_limit_per_user\` + `); + await queryRunner.query(` + ALTER TABLE \`channels\` DROP COLUMN \`flags\` + `); + await queryRunner.query(` + DROP TABLE \`plugin_config\` + `); + await queryRunner.query(` + CREATE UNIQUE INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\` (\`settingsId\`) + `); + } + +} -- cgit 1.5.1