summary refs log tree commit diff
path: root/src/util/migrations/mariadb/1661785289467-guild-member-profiles.ts
blob: 223876f9e1eb0f91abebe8429dac2df01bcab3d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
        `);
    }

}