summary refs log tree commit diff
path: root/src/util/migrations/mariadb/1659921859145-premium_since_as_date.ts
blob: 549d6b9f0bf96760bb58bed40dcb1154772c6c35 (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
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
        `);
	}
}