summary refs log tree commit diff
path: root/src/database/migration/postgres/1771997061671-LastPinTimestampAsDate.ts
blob: a5aaf474904af3c0522abaf2d03185528a20fd91 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { MigrationInterface, QueryRunner } from "typeorm";

export class LastPinTimestampAsDate1771997061671 implements MigrationInterface {
    name = "LastPinTimestampAsDate1771997061671";

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "channels" DROP COLUMN "last_pin_timestamp"`);
        await queryRunner.query(`ALTER TABLE "channels" ADD "last_pin_timestamp" TIMESTAMP WITH TIME ZONE`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "channels" DROP COLUMN "last_pin_timestamp"`);
        await queryRunner.query(`ALTER TABLE "channels" ADD "last_pin_timestamp" integer`);
    }
}