From 9ab2599e0da4d1f9f47a92087b11a2a21a9aa387 Mon Sep 17 00:00:00 2001 From: Cleo John <30842467+CutestNekoAqua@users.noreply.github.com> Date: Thu, 24 Nov 2022 11:32:25 +0000 Subject: [PATCH] db migration for moved to --- bun.lockb | 3 +++ packages/backend/bun.lockb | 3 +++ .../1669288094000-AddMovedToAndKnownAs.js | 16 ++++++++++++++++ packages/backend/src/models/entities/user.ts | 6 ++++++ packages/sw/bun.lockb | 3 +++ 5 files changed, 31 insertions(+) create mode 100755 bun.lockb create mode 100755 packages/backend/bun.lockb create mode 100644 packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js create mode 100755 packages/sw/bun.lockb diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 000000000..31eaaea1d --- /dev/null +++ b/bun.lockb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1c38fd62d3a95d883fed6b4eb1ea16126667248f4c03a4ac4c0367d21ac2de1 +size 255080 diff --git a/packages/backend/bun.lockb b/packages/backend/bun.lockb new file mode 100755 index 000000000..e10adde91 --- /dev/null +++ b/packages/backend/bun.lockb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc69a322b5dd9baec1f8713ed24f27e2f1c396e403a3fa7d358ecad865357ddb +size 399520 diff --git a/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js new file mode 100644 index 000000000..8936c3503 --- /dev/null +++ b/packages/backend/migration/1669288094000-AddMovedToAndKnownAs.js @@ -0,0 +1,16 @@ +export class addMovedToAndKnownAs1669288094000 { + name = 'addMovedToAndKnownAs1669288094000' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" ADD "movedToUri" character varying(512)`); + await queryRunner.query(`ALTER TABLE "user" ADD "knownAs" TEXT []`); + await queryRunner.query(`COMMENT ON COLUMN "user"."movedToUri" IS 'The URI of the new account of the User'`); + await queryRunner.query(`COMMENT ON COLUMN "user"."knownAs" IS 'URIs the user is known as too'`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "movedToUri"`); + await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "knownAs"`); + } + +} diff --git a/packages/backend/src/models/entities/user.ts b/packages/backend/src/models/entities/user.ts index bc9446be4..9d79c42e6 100644 --- a/packages/backend/src/models/entities/user.ts +++ b/packages/backend/src/models/entities/user.ts @@ -68,6 +68,12 @@ export class User { }) public followingCount: number; + @Column('varchar', { + length: 512, nullable: true, + comment: 'The URI of the new account of the User', + }) + public movedToUri: string | null; + @Column('integer', { default: 0, comment: 'The count of notes.', diff --git a/packages/sw/bun.lockb b/packages/sw/bun.lockb new file mode 100755 index 000000000..2e4e467a7 --- /dev/null +++ b/packages/sw/bun.lockb @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:794ad1609465ce05a365b412bdf602993c1f113b4c0af7716aba8fc8c40d7f7f +size 43759