mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-23 14:03:10 +02:00
Fix: DB CONSTRAINT of RenoteMuting (#11724)
* Fix: DB CONSTRAINT of RenoteMuting * change order of migration of fixing renotemuting
This commit is contained in:
parent
3eacbe6b6d
commit
750085ffd5
2 changed files with 16 additions and 0 deletions
|
@ -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"`);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue