Skip to content

Commit

Permalink
fix: lastActiveAt migration (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
annarhughes committed Jun 18, 2024
1 parent b9dc864 commit b9d81c8
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/migrations/1718300621138-bloom-backend.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { MigrationInterface, QueryRunner } from 'typeorm';

export class BloomBackend1718300621138 implements MigrationInterface {
name = 'BloomBackend1718300621138'
name = 'BloomBackend1718300621138';

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

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

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

0 comments on commit b9d81c8

Please sign in to comment.