Skip to content

Commit

Permalink
release: v2024.5.0-kakurega.1.38.1 (#152)
Browse files Browse the repository at this point in the history
  • Loading branch information
hideki0403 authored Jul 27, 2024
2 parents 93861ee + 077ae0a commit 98e12ea
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG_KAKUREGA.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.38.1
Release: 2024/07/28
Base: 2024.5.0

### 修正
- バニラMisskeyからの移行時にマイグレーションが失敗する問題を修正

## 1.38.0
Release: 2024/06/29
Base: 2024.5.0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "misskey",
"version": "2024.5.0-kakurega.1.38.0",
"version": "2024.5.0-kakurega.1.38.1",
"codename": "nasubi",
"repository": {
"type": "git",
Expand Down
17 changes: 11 additions & 6 deletions packages/backend/migration/1682932943132-note-notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ export class NoteNotification1682932943132 {
await queryRunner.query(`CREATE TABLE "note_notification" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "targetUserId" character varying(32) NOT NULL, CONSTRAINT "PK_02dd5dcc82f04263ad78720dccc" PRIMARY KEY ("id"))`);
await queryRunner.query(`CREATE INDEX "IDX_2d0b2c0212af304221fe1abd94" ON "note_notification" ("userId") `);
await queryRunner.query(`CREATE INDEX "IDX_73b01aaac615137c472f410a99" ON "note_notification" ("targetUserId") `);
await queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" RENAME TO "user_profile_mutingnotificationtypes_enum_old"`);
await queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'note', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app', 'pollVote', 'groupInvited')`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum"[]`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`);
await queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum_old"`);

const userProfileTable = await queryRunner.getTable("user_profile");
if (userProfileTable.columns.find(column => column.name === "mutingNotificationTypes") != null) {
await queryRunner.query(`ALTER TYPE "public"."user_profile_mutingnotificationtypes_enum" RENAME TO "user_profile_mutingnotificationtypes_enum_old"`);
await queryRunner.query(`CREATE TYPE "public"."user_profile_mutingnotificationtypes_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'note', 'pollEnded', 'receiveFollowRequest', 'followRequestAccepted', 'achievementEarned', 'app', 'pollVote', 'groupInvited')`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" DROP DEFAULT`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" TYPE "public"."user_profile_mutingnotificationtypes_enum"[] USING "mutingNotificationTypes"::"text"::"public"."user_profile_mutingnotificationtypes_enum"[]`);
await queryRunner.query(`ALTER TABLE "user_profile" ALTER COLUMN "mutingNotificationTypes" SET DEFAULT '{}'`);
await queryRunner.query(`DROP TYPE "public"."user_profile_mutingnotificationtypes_enum_old"`);
}

await queryRunner.query(`ALTER TABLE "note_notification" ADD CONSTRAINT "FK_2d0b2c0212af304221fe1abd940" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
await queryRunner.query(`ALTER TABLE "note_notification" ADD CONSTRAINT "FK_73b01aaac615137c472f410a996" FOREIGN KEY ("targetUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`);
}
Expand Down

0 comments on commit 98e12ea

Please sign in to comment.