1
0
Fork 1
mirror of https://example.com synced 2024-11-24 07:26:39 +09:00
firefish/migration/1618637372000-user-last-active-date.ts
syuilo 68571d8f57 Implement user online status
Resolve #7422
Fix #7424
2021-04-17 15:30:26 +09:00

16 lines
719 B
TypeScript

import {MigrationInterface, QueryRunner} from "typeorm";
export class userLastActiveDate1618637372000 implements MigrationInterface {
name = 'userLastActiveDate1618637372000'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "user" ADD "lastActiveDate" TIMESTAMP WITH TIME ZONE DEFAULT NULL`);
await queryRunner.query(`CREATE INDEX "IDX_seoignmeoprigmkpodgrjmkpormg" ON "user" ("lastActiveDate") `);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP INDEX "IDX_seoignmeoprigmkpodgrjmkpormg"`);
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "lastActiveDate"`);
}
}