summary refs log tree commit diff
path: root/src/util/migrations/mariadb
diff options
context:
space:
mode:
authorPuyodead1 <puyodead@protonmail.com>2022-08-29 11:11:40 -0400
committerPuyodead1 <puyodead@protonmail.com>2022-08-29 11:11:40 -0400
commitc2aba2910cb50211a91a057863ef0bd0497ceead (patch)
tree8fa7c143dd0f397ede278f688dc3d86c5195815e /src/util/migrations/mariadb
parentOop, deprecated typeorm call (diff)
downloadserver-c2aba2910cb50211a91a057863ef0bd0497ceead.tar.xz
implement guild profiles and fix user profiles
Diffstat (limited to 'src/util/migrations/mariadb')
-rw-r--r--src/util/migrations/mariadb/1661785289467-guild-member-profiles.ts60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/util/migrations/mariadb/1661785289467-guild-member-profiles.ts b/src/util/migrations/mariadb/1661785289467-guild-member-profiles.ts
new file mode 100644
index 00000000..223876f9
--- /dev/null
+++ b/src/util/migrations/mariadb/1661785289467-guild-member-profiles.ts
@@ -0,0 +1,60 @@
+import { MigrationInterface, QueryRunner } from "typeorm";
+
+export class guildMemberProfiles1661785289467 implements MigrationInterface {
+    name = 'guildMemberProfiles1661785289467'
+
+    public async up(queryRunner: QueryRunner): Promise<void> {
+        await queryRunner.query(`
+            ALTER TABLE \`connected_accounts\` DROP COLUMN \`external_id\`
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`connected_accounts\` DROP COLUMN \`integrations\`
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\`
+            ADD \`avatar\` varchar(255) NULL
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\`
+            ADD \`banner\` varchar(255) NULL
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\`
+            ADD \`bio\` varchar(255) NOT NULL
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\`
+            ADD \`communication_disabled_until\` datetime NULL
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`connected_accounts\` CHANGE \`access_token\` \`access_token\` varchar(255) NOT NULL
+        `);
+    }
+
+    public async down(queryRunner: QueryRunner): Promise<void> {
+        await queryRunner.query(`
+            ALTER TABLE \`connected_accounts\` CHANGE \`access_token\` \`access_token\` varchar(255) NULL
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\` DROP COLUMN \`communication_disabled_until\`
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\` DROP COLUMN \`bio\`
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\` DROP COLUMN \`banner\`
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`members\` DROP COLUMN \`avatar\`
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`connected_accounts\`
+            ADD \`integrations\` text NOT NULL
+        `);
+        await queryRunner.query(`
+            ALTER TABLE \`connected_accounts\`
+            ADD \`external_id\` varchar(255) NOT NULL
+        `);
+    }
+
+}