summary refs log tree commit diff
path: root/src/util/migrations/mariadb/1661785289467-guild-member-profiles.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/migrations/mariadb/1661785289467-guild-member-profiles.ts')
-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
+        `);
+    }
+
+}