From b2b9c7991e46f1d02ff74932937e78459cbb5539 Mon Sep 17 00:00:00 2001 From: pen <121443048+penginn-net@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:40:16 +0900 Subject: [PATCH] =?UTF-8?q?searchableBy=E3=81=AE=E3=83=9E=E3=82=A4?= =?UTF-8?q?=E3=82=B0=E3=83=AC=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E3=82=92?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20(#529)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../backend/migration/1729457336777-AddSearchable.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/backend/migration/1729457336777-AddSearchable.js b/packages/backend/migration/1729457336777-AddSearchable.js index b8485e57ef..08cd89369d 100644 --- a/packages/backend/migration/1729457336777-AddSearchable.js +++ b/packages/backend/migration/1729457336777-AddSearchable.js @@ -6,15 +6,16 @@ export class AddSearchable1729457336777 { name = 'AddSearchable1729457336777'; async up(queryRunner) { - await queryRunner.query('ALTER TABLE "user" ADD "searchableBy" "public"."user_searchableby_enum"'); + await queryRunner.query('CREATE TYPE "public"."user_searchableby_enum" AS ENUM(\'public\', \'followersAndReacted\', \'reactedOnly\', \'private\')'); await queryRunner.query('CREATE TYPE "public"."note_searchableby_enum" AS ENUM(\'public\', \'followersAndReacted\', \'reactedOnly\', \'private\')'); + await queryRunner.query('ALTER TABLE "user" ADD "searchableBy" "public"."user_searchableby_enum"'); await queryRunner.query('ALTER TABLE "note" ADD "searchableBy" "public"."note_searchableby_enum"'); - await queryRunner.query('CREATE INDEX "IDX_3932b42da4cf440203d2013649" ON "user" ("searchableBy") '); - } + } async down(queryRunner) { await queryRunner.query('ALTER TABLE "note" DROP COLUMN "searchableBy"'); - await queryRunner.query('DROP TYPE "public"."note_searchableby_enum"'); await queryRunner.query('ALTER TABLE "user" DROP COLUMN "searchableBy"'); + await queryRunner.query('DROP TYPE "public"."note_searchableby_enum"'); + await queryRunner.query('DROP TYPE "public"."user_searchableby_enum"'); } };