diff --git a/docs/downgrade.sql b/docs/downgrade.sql index eed0079c3b..8f9dc74d06 100644 --- a/docs/downgrade.sql +++ b/docs/downgrade.sql @@ -1,6 +1,7 @@ BEGIN; DELETE FROM "migrations" WHERE name IN ( + 'CreateScheduledNoteCreation1714728200194', 'AlterAkaType1714099399879', 'AddDriveFileUsage1713451569342', 'ConvertCwVarcharToText1713225866247', @@ -25,6 +26,9 @@ DELETE FROM "migrations" WHERE name IN ( 'RemoveNativeUtilsMigration1705877093218' ); +-- create-scheduled-note-creation +DROP TABLE "scheduled_note_creation"; + -- alter-aka-type ALTER TABLE "user" RENAME COLUMN "alsoKnownAs" TO "alsoKnownAsOld"; ALTER TABLE "user" ADD COLUMN "alsoKnownAs" text; diff --git a/packages/backend/src/migration/1714728200194-create-scheduled-note-creation.ts b/packages/backend/src/migration/1714728200194-create-scheduled-note-creation.ts index 1af13a229b..d6884f5f0e 100644 --- a/packages/backend/src/migration/1714728200194-create-scheduled-note-creation.ts +++ b/packages/backend/src/migration/1714728200194-create-scheduled-note-creation.ts @@ -6,11 +6,10 @@ export class CreateScheduledNoteCreation1714728200194 public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "scheduled_note_creation" ( - "id" character varying(32) NOT NULL, + "id" character varying(32) NOT NULL PRIMARY KEY, "noteId" character varying(32) NOT NULL, "userId" character varying(32) NOT NULL, - "scheduledAt" TIMESTAMP WITHOUT TIME ZONE NOT NULL, - CONSTRAINT "PK_id_ScheduledNoteCreation" PRIMARY KEY ("id") + "scheduledAt" TIMESTAMP WITHOUT TIME ZONE NOT NULL )`, ); await queryRunner.query(` @@ -24,31 +23,19 @@ export class CreateScheduledNoteCreation1714728200194 `); await queryRunner.query(` ALTER TABLE "scheduled_note_creation" - ADD CONSTRAINT "FK_noteId_ScheduledNoteCreation" - FOREIGN KEY ("noteId") - REFERENCES "note"("id") + ADD FOREIGN KEY ("noteId") REFERENCES "note"("id") ON DELETE CASCADE ON UPDATE NO ACTION `); await queryRunner.query(` ALTER TABLE "scheduled_note_creation" - ADD CONSTRAINT "FK_userId_ScheduledNoteCreation" - FOREIGN KEY ("userId") - REFERENCES "user"("id") + ADD FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION `); } public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(` - ALTER TABLE "scheduled_note_creation" DROP CONSTRAINT "FK_noteId_ScheduledNoteCreation" - `); - await queryRunner.query(` - ALTER TABLE "scheduled_note_creation" DROP CONSTRAINT "FK_userId_ScheduledNoteCreation" - `); - await queryRunner.query(` - DROP TABLE "scheduled_note_creation" - `); + await queryRunner.query(`DROP TABLE "scheduled_note_creation"`); } } diff --git a/packages/backend/src/remote/activitypub/misc/contexts.ts b/packages/backend/src/remote/activitypub/misc/contexts.ts index 5b43bf5fc3..d0b3f56fc1 100644 --- a/packages/backend/src/remote/activitypub/misc/contexts.ts +++ b/packages/backend/src/remote/activitypub/misc/contexts.ts @@ -527,7 +527,7 @@ export const WellKnownContext = { manuallyApprovesFollowers: "as:manuallyApprovesFollowers", movedTo: { "@id": "https://www.w3.org/ns/activitystreams#movedTo", - "@type": "@id" + "@type": "@id", }, movedToUri: "as:movedTo", sensitive: "as:sensitive",