summary refs log tree commit diff
path: root/util/src/migrations/1660689892073-mobileFixes2.ts
blob: 3432896615fed3f3f6667bdcc01005b92a7fb601 (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
import { MigrationInterface, QueryRunner } from "typeorm";

export class mobileFixes21660689892073 implements MigrationInterface {
    name = 'mobileFixes21660689892073'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            ALTER TABLE \`user_settings\`
            ADD \`banner_color\` varchar(255) NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`channels\` CHANGE \`nsfw\` \`nsfw\` tinyint NOT NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`guilds\` CHANGE \`nsfw\` \`nsfw\` tinyint NOT NULL
        `);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            ALTER TABLE \`guilds\` CHANGE \`nsfw\` \`nsfw\` tinyint NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`channels\` CHANGE \`nsfw\` \`nsfw\` tinyint NULL
        `);
        await queryRunner.query(`
            ALTER TABLE \`user_settings\` DROP COLUMN \`banner_color\`
        `);
    }

}