sharkey/packages/backend/migration/1702718871542-notesvisibility.js
ひたりん bf40bc4fe3 Merge pull request #40 from lqvp/master
ノート数を隠せるように
2024-11-03 22:06:43 +09:00

23 lines
820 B
JavaScript

/*
* SPDX-FileCopyrightText: syuilo and misskey-project
* SPDX-License-Identifier: AGPL-3.0-only
*/
export class notesvisibility1702718871542 {
constructor() {
this.name = 'notesvisibility1702718871542';
}
async up(queryRunner) {
await queryRunner.query(`CREATE TYPE "public"."user_profile_notesVisibility_enum" AS ENUM('public', 'followers', 'private')`);
await queryRunner.query(`ALTER TABLE "user_profile" ADD "notesVisibility" "public"."user_profile_notesVisibility_enum" NOT NULL DEFAULT 'public'`);
await queryRunner.query(`UPDATE "user_profile" SET "notesVisibility" = 'public'`);
}
async down(queryRunner) {
await queryRunner.query(`ALTER TABLE "user_profile" DROP COLUMN "notesVisibility"`);
await queryRunner.query(`DROP TYPE "public"."user_profile_notesVisibility_enum"`);
}
}