egirlskey/migration/1636197624383-ff-visibility.ts
syuilo a28c515ef6
feat: make possible to configure following/followers visibility (#7959)
* feat: make possible to configure following/followers visibility

* add test

* ap

* add ap test

* set Cache-Control

* hide following/followers count
2021-11-07 18:04:32 +09:00

16 lines
773 B
TypeScript

import {MigrationInterface, QueryRunner} from "typeorm";
export class ffVisibility1636197624383 implements MigrationInterface {
name = 'ffVisibility1636197624383'
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TYPE "public"."user_profile_ffvisibility_enum" AS ENUM('public', 'followers', 'private')`);
await queryRunner.query(`ALTER TABLE "user_profile" ADD "ffVisibility" "public"."user_profile_ffvisibility_enum" NOT NULL DEFAULT 'public'`);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "ffVisibility"`);
await queryRunner.query(`DROP TYPE "public"."user_profile_ffvisibility_enum"`);
}
}