parent
61461b7f59
commit
68571d8f57
10 changed files with 92 additions and 9 deletions
16
migration/1618637372000-user-last-active-date.ts
Normal file
16
migration/1618637372000-user-last-active-date.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
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"`);
|
||||
}
|
||||
|
||||
}
|
14
migration/1618639857000-user-hide-online-status.ts
Normal file
14
migration/1618639857000-user-hide-online-status.ts
Normal file
|
@ -0,0 +1,14 @@
|
|||
import {MigrationInterface, QueryRunner} from "typeorm";
|
||||
|
||||
export class userHideOnlineStatus1618639857000 implements MigrationInterface {
|
||||
name = 'userHideOnlineStatus1618639857000'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "user" ADD "hideOnlineStatus" boolean NOT NULL DEFAULT false`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "hideOnlineStatus"`);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue