summary refs log tree commit diff
path: root/src/util/migrations
diff options
context:
space:
mode:
authorErkin Alp Güney <erkinalp9035@gmail.com>2022-08-23 23:11:51 +0300
committerTheArcaneBrony <myrainbowdash949@gmail.com>2022-09-04 10:01:42 +0200
commit2094d57c1466e894e81d15b4e9f9252322966103 (patch)
tree03c382436dfe4643996237377509699d969686fa /src/util/migrations
parentVarious fixes for current web client (#875) (diff)
downloadserver-2094d57c1466e894e81d15b4e9f9252322966103.tar.xz
flags related rights and stats api
Diffstat (limited to 'src/util/migrations')
-rw-r--r--src/util/migrations/mariadb/1661273147273-test.ts71
-rw-r--r--src/util/migrations/mariadb/1661273179287-test2.ts15
2 files changed, 42 insertions, 44 deletions
diff --git a/src/util/migrations/mariadb/1661273147273-test.ts b/src/util/migrations/mariadb/1661273147273-test.ts
index 4e077a11..0090e2aa 100644
--- a/src/util/migrations/mariadb/1661273147273-test.ts
+++ b/src/util/migrations/mariadb/1661273147273-test.ts
@@ -1,23 +1,23 @@
 import { MigrationInterface, QueryRunner } from "typeorm";
 
 export class test1661273147273 implements MigrationInterface {
-    name = 'test1661273147273'
+	name = "test1661273147273";
 
-    public async up(queryRunner: QueryRunner): Promise<void> {
-        await queryRunner.query(`
+	public async up(queryRunner: QueryRunner): Promise<void> {
+		await queryRunner.query(`
             ALTER TABLE \`invites\` DROP FOREIGN KEY \`FK_15c35422032e0b22b4ada95f48f\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             DROP INDEX \`IDX_2ce5a55796fe4c2f77ece57a64\` ON \`applications\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             CREATE TABLE \`plugin_config\` (
                 \`key\` varchar(255) NOT NULL,
                 \`value\` text NULL,
                 PRIMARY KEY (\`key\`)
             ) ENGINE = InnoDB
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             CREATE TABLE \`user_settings\` (
                 \`id\` varchar(255) NOT NULL,
                 \`afk_timeout\` int NULL,
@@ -54,96 +54,95 @@ export class test1661273147273 implements MigrationInterface {
                 PRIMARY KEY (\`id\`)
             ) ENGINE = InnoDB
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` DROP COLUMN \`settings\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\`
             ADD \`settingsId\` varchar(255) NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\`
             ADD UNIQUE INDEX \`IDX_76ba283779c8441fd5ff819c8c\` (\`settingsId\`)
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`channels\`
             ADD \`flags\` int NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`channels\`
             ADD \`default_thread_rate_limit_per_user\` int NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`guilds\`
             ADD \`premium_progress_bar_enabled\` tinyint NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` CHANGE \`bio\` \`bio\` varchar(255) NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` CHANGE \`mfa_enabled\` \`mfa_enabled\` tinyint NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             CREATE UNIQUE INDEX \`REL_76ba283779c8441fd5ff819c8c\` ON \`users\` (\`settingsId\`)
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\`
             ADD CONSTRAINT \`FK_76ba283779c8441fd5ff819c8cf\` FOREIGN KEY (\`settingsId\`) REFERENCES \`user_settings\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`invites\`
             ADD CONSTRAINT \`FK_15c35422032e0b22b4ada95f48f\` FOREIGN KEY (\`inviter_id\`) REFERENCES \`users\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION
         `);
-    }
+	}
 
-    public async down(queryRunner: QueryRunner): Promise<void> {
-        await queryRunner.query(`
+	public async down(queryRunner: QueryRunner): Promise<void> {
+		await queryRunner.query(`
             ALTER TABLE \`invites\` DROP FOREIGN KEY \`FK_15c35422032e0b22b4ada95f48f\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` DROP FOREIGN KEY \`FK_76ba283779c8441fd5ff819c8cf\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             DROP INDEX \`REL_76ba283779c8441fd5ff819c8c\` ON \`users\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` CHANGE \`mfa_enabled\` \`mfa_enabled\` tinyint NOT NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` CHANGE \`bio\` \`bio\` varchar(255) NOT NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`guilds\` DROP COLUMN \`premium_progress_bar_enabled\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`channels\` DROP COLUMN \`default_thread_rate_limit_per_user\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`channels\` DROP COLUMN \`flags\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` DROP INDEX \`IDX_76ba283779c8441fd5ff819c8c\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\` DROP COLUMN \`settingsId\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`users\`
             ADD \`settings\` text NOT NULL
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             DROP TABLE \`user_settings\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             DROP TABLE \`plugin_config\`
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             CREATE UNIQUE INDEX \`IDX_2ce5a55796fe4c2f77ece57a64\` ON \`applications\` (\`bot_user_id\`)
         `);
-        await queryRunner.query(`
+		await queryRunner.query(`
             ALTER TABLE \`invites\`
             ADD CONSTRAINT \`FK_15c35422032e0b22b4ada95f48f\` FOREIGN KEY (\`inviter_id\`) REFERENCES \`users\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION
         `);
-    }
-
+	}
 }
diff --git a/src/util/migrations/mariadb/1661273179287-test2.ts b/src/util/migrations/mariadb/1661273179287-test2.ts
index 0f77f284..973d8124 100644
--- a/src/util/migrations/mariadb/1661273179287-test2.ts
+++ b/src/util/migrations/mariadb/1661273179287-test2.ts
@@ -1,18 +1,17 @@
 import { MigrationInterface, QueryRunner } from "typeorm";
 
 export class test21661273179287 implements MigrationInterface {
-    name = 'test21661273179287'
+	name = "test21661273179287";
 
-    public async up(queryRunner: QueryRunner): Promise<void> {
-        await queryRunner.query(`
+	public async up(queryRunner: QueryRunner): Promise<void> {
+		await queryRunner.query(`
             DROP INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\`
         `);
-    }
+	}
 
-    public async down(queryRunner: QueryRunner): Promise<void> {
-        await queryRunner.query(`
+	public async down(queryRunner: QueryRunner): Promise<void> {
+		await queryRunner.query(`
             CREATE UNIQUE INDEX \`IDX_76ba283779c8441fd5ff819c8c\` ON \`users\` (\`settingsId\`)
         `);
-    }
-
+	}
 }