`CREATE TABLE "user_group_invitation" ("id" character varying(32) NOT NULL, "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, "userId" character varying(32) NOT NULL, "userGroupId" character varying(32) NOT NULL, CONSTRAINT "PK_160c63ec02bf23f6a5c5e8140d6" PRIMARY KEY ("id"))`,
undefined,
);
awaitqueryRunner.query(
`CREATE INDEX "IDX_bfbc6305547539369fe73eb144" ON "user_group_invitation" ("userId") `,
undefined,
);
awaitqueryRunner.query(
`CREATE INDEX "IDX_5cc8c468090e129857e9fecce5" ON "user_group_invitation" ("userGroupId") `,
undefined,
);
awaitqueryRunner.query(
`CREATE UNIQUE INDEX "IDX_e9793f65f504e5a31fbaedbf2f" ON "user_group_invitation" ("userId", "userGroupId") `,
undefined,
);
awaitqueryRunner.query(
`ALTER TABLE "notification" ADD "userGroupInvitationId" character varying(32)`,
undefined,
);
awaitqueryRunner.query(
`ALTER TYPE "public"."notification_type_enum" RENAME TO "notification_type_enum_old"`,
undefined,
);
awaitqueryRunner.query(
`CREATE TYPE "notification_type_enum" AS ENUM('follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited')`,
undefined,
);
awaitqueryRunner.query(
`ALTER TABLE "notification" ALTER COLUMN "type" TYPE "notification_type_enum" USING "type"::"text"::"notification_type_enum"`,
undefined,
);
awaitqueryRunner.query(
`DROP TYPE "notification_type_enum_old"`,
undefined,
);
awaitqueryRunner.query(
`COMMENT ON COLUMN "notification"."type" IS 'The type of the Notification.'`,
undefined,
);
awaitqueryRunner.query(
`ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_bfbc6305547539369fe73eb144a" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
undefined,
);
awaitqueryRunner.query(
`ALTER TABLE "user_group_invitation" ADD CONSTRAINT "FK_5cc8c468090e129857e9fecce5a" FOREIGN KEY ("userGroupId") REFERENCES "user_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,
undefined,
);
awaitqueryRunner.query(
`ALTER TABLE "notification" ADD CONSTRAINT "FK_8fe87814e978053a53b1beb7e98" FOREIGN KEY ("userGroupInvitationId") REFERENCES "user_group_invitation"("id") ON DELETE CASCADE ON UPDATE NO ACTION`,