summary refs log tree commit diff
path: root/src/util/migrations/postgres/1661885830688-guild-member-profiles.ts
blob: b774743b192bfe096b3596d53f522a31c82aee78 (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
import { MigrationInterface, QueryRunner } from "typeorm";

export class guildMemberProfiles1661885830688 implements MigrationInterface {
    name = 'guildMemberProfiles1661885830688'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            ALTER TABLE "members"
            ADD "avatar" character varying
        `);
        await queryRunner.query(`
            ALTER TABLE "members"
            ADD "banner" character varying
        `);
        await queryRunner.query(`
            ALTER TABLE "members"
            ADD "bio" character varying NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE "members"
            ADD "communication_disabled_until" TIMESTAMP
        `);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        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"
        `);
    }

}