Skip to content

Commit b9d81c8

Browse files
authored
fix: lastActiveAt migration (#485)
1 parent b9dc864 commit b9d81c8

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed
+8-11
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
1-
import { MigrationInterface, QueryRunner } from "typeorm";
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
22

33
export class BloomBackend1718300621138 implements MigrationInterface {
4-
name = 'BloomBackend1718300621138'
4+
name = 'BloomBackend1718300621138';
55

6-
public async up(queryRunner: QueryRunner): Promise<void> {
7-
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "lastActiveAt"`);
8-
await queryRunner.query(`ALTER TABLE "user" ADD "lastActiveAt" TIMESTAMP WITH TIME ZONE`);
9-
}
10-
11-
public async down(queryRunner: QueryRunner): Promise<void> {
12-
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "lastActiveAt"`);
13-
await queryRunner.query(`ALTER TABLE "user" ADD "lastActiveAt" date`);
14-
}
6+
public async up(queryRunner: QueryRunner): Promise<void> {
7+
await queryRunner.query(`ALTER TABLE "user" ADD "lastActiveAt" TIMESTAMP WITH TIME ZONE`);
8+
}
159

10+
public async down(queryRunner: QueryRunner): Promise<void> {
11+
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "lastActiveAt"`);
12+
}
1613
}

0 commit comments

Comments
 (0)