diff options
| author | atsuchan <83960488+atsu1125@users.noreply.github.com> | 2023-08-20 13:22:37 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-20 13:22:37 +0900 |
| commit | 750085ffd53b7b8e9de3d9a41f88349e7264a564 (patch) | |
| tree | 899b70c4f20f559f94688106a045f159e6b40365 | |
| parent | enhance(backend): Add address bind config option (#11725) (diff) | |
| download | sharkey-750085ffd53b7b8e9de3d9a41f88349e7264a564.tar.gz sharkey-750085ffd53b7b8e9de3d9a41f88349e7264a564.tar.bz2 sharkey-750085ffd53b7b8e9de3d9a41f88349e7264a564.zip | |
Fix: DB CONSTRAINT of RenoteMuting (#11724)
* Fix: DB CONSTRAINT of RenoteMuting
* change order of migration of fixing renotemuting
| -rw-r--r-- | packages/backend/migration/1665091090561-add-renote-muting.js | 4 | ||||
| -rw-r--r-- | packages/backend/migration/1690417561185-fix-renote-muting.js | 12 |
2 files changed, 16 insertions, 0 deletions
diff --git a/packages/backend/migration/1665091090561-add-renote-muting.js b/packages/backend/migration/1665091090561-add-renote-muting.js index 575a63703c..a22d7037f3 100644 --- a/packages/backend/migration/1665091090561-add-renote-muting.js +++ b/packages/backend/migration/1665091090561-add-renote-muting.js @@ -16,5 +16,9 @@ export class addRenoteMuting1665091090561 { } async down(queryRunner) { + await queryRunner.query(`DROP INDEX "IDX_renote_muting_muterId"`); + await queryRunner.query(`DROP INDEX "IDX_renote_muting_muteeId"`); + await queryRunner.query(`DROP INDEX "IDX_renote_muting_createdAt"`); + await queryRunner.query(`DROP TABLE "renote_muting"`); } } diff --git a/packages/backend/migration/1690417561185-fix-renote-muting.js b/packages/backend/migration/1690417561185-fix-renote-muting.js new file mode 100644 index 0000000000..14150b0362 --- /dev/null +++ b/packages/backend/migration/1690417561185-fix-renote-muting.js @@ -0,0 +1,12 @@ +export class FixRenoteMuting1690417561185 { + name = 'FixRenoteMuting1690417561185' + + async up(queryRunner) { + await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muteeId" NOT IN (SELECT "id" FROM "user")`); + await queryRunner.query(`DELETE FROM "renote_muting" WHERE "muterId" NOT IN (SELECT "id" FROM "user")`); + } + + async down(queryRunner) { + + } +} |