Skip to content

Commit

Permalink
searchableByのマイグレーションを修正 (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
penginn-net authored Nov 5, 2024
1 parent d1ad89e commit b2b9c79
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/backend/migration/1729457336777-AddSearchable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"');
}
};

0 comments on commit b2b9c79

Please sign in to comment.