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

export class premiumSinceAsDate1659921859145 implements MigrationInterface {
    name = 'premiumSinceAsDate1659921859145'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            ALTER TABLE \`members\` DROP COLUMN \`premium_since\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`members\`
            ADD \`premium_since\` datetime NULL
        `);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`
            ALTER TABLE \`members\` DROP COLUMN \`premium_since\`
        `);
        await queryRunner.query(`
            ALTER TABLE \`members\`
            ADD \`premium_since\` bigint NULL
        `);
    }

}