forked from misskey-dev/misskey
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
162 additions
and
20 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
packages/backend/migration/1725101670794-userIdToRegistrationTicket.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export class UserIdToRegistrationTicket1725101670794 { | ||
name = 'UserIdToRegistrationTicket1725101670794' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" ADD "requestUserId" character varying(32)`); | ||
await queryRunner.query(`COMMENT ON COLUMN "registration_ticket"."requestUserId" IS 'The request user ID.'`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" ADD "invitedUserId" character varying(32)`); | ||
await queryRunner.query(`COMMENT ON COLUMN "registration_ticket"."invitedUserId" IS 'The invited user ID.'`); | ||
await queryRunner.query(`CREATE INDEX "IDX_0b96e37dbfcc3c151b9a84b1a9" ON "registration_ticket" ("requestUserId") `); | ||
await queryRunner.query(`CREATE INDEX "IDX_cfcbf86bed74362ef7e0d43a0c" ON "registration_ticket" ("invitedUserId") `); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" ADD "usedAt" TIMESTAMP`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" ADD CONSTRAINT "FK_0b96e37dbfcc3c151b9a84b1a95" FOREIGN KEY ("requestUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" ADD CONSTRAINT "FK_cfcbf86bed74362ef7e0d43a0c3" FOREIGN KEY ("invitedUserId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" DROP CONSTRAINT "FK_cfcbf86bed74362ef7e0d43a0c3"`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" DROP CONSTRAINT "FK_0b96e37dbfcc3c151b9a84b1a95"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_cfcbf86bed74362ef7e0d43a0c"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_0b96e37dbfcc3c151b9a84b1a9"`); | ||
await queryRunner.query(`COMMENT ON COLUMN "registration_ticket"."invitedUserId" IS 'The invited user ID.'`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" DROP COLUMN "invitedUserId"`); | ||
await queryRunner.query(`COMMENT ON COLUMN "registration_ticket"."requestUserId" IS 'The request user ID.'`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" DROP COLUMN "requestUserId"`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" DROP COLUMN "usedAt"`); | ||
|
||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
packages/backend/migration/1725104341375-registrationTicketToUserPending.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
export class RegistrationTicketToUserPending1725104341375 { | ||
name = 'RegistrationTicketToUserPending1725104341375' | ||
|
||
async up(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "user_pending" ADD "registrationTicketId" character varying(32)`); | ||
await queryRunner.query(`COMMENT ON COLUMN "user_pending"."registrationTicketId" IS 'The registration ticket ID.'`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" DROP COLUMN "usedAt"`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" ADD "usedAt" TIMESTAMP WITH TIME ZONE`); | ||
await queryRunner.query(`COMMENT ON COLUMN "registration_ticket"."usedAt" IS 'The date and time the ticket was used.'`); | ||
await queryRunner.query(`CREATE INDEX "IDX_80e9a0b6943dd3e821b9bdd3cf" ON "user_pending" ("registrationTicketId") `); | ||
await queryRunner.query(`ALTER TABLE "user_pending" ADD CONSTRAINT "FK_80e9a0b6943dd3e821b9bdd3cf3" FOREIGN KEY ("registrationTicketId") REFERENCES "registration_ticket"("id") ON DELETE CASCADE ON UPDATE NO ACTION`); | ||
} | ||
|
||
async down(queryRunner) { | ||
await queryRunner.query(`ALTER TABLE "user_pending" DROP CONSTRAINT "FK_80e9a0b6943dd3e821b9bdd3cf3"`); | ||
await queryRunner.query(`DROP INDEX "public"."IDX_80e9a0b6943dd3e821b9bdd3cf"`); | ||
await queryRunner.query(`COMMENT ON COLUMN "registration_ticket"."usedAt" IS 'The date and time the ticket was used.'`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" DROP COLUMN "usedAt"`); | ||
await queryRunner.query(`ALTER TABLE "registration_ticket" ADD "usedAt" TIMESTAMP`); | ||
await queryRunner.query(`COMMENT ON COLUMN "user_pending"."registrationTicketId" IS 'The registration ticket ID.'`); | ||
await queryRunner.query(`ALTER TABLE "user_pending" DROP COLUMN "registrationTicketId"`); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters