add migration; copy suspended state from user table
This commit is contained in:
parent
77a11e369f
commit
3a5870b9a5
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
module.exports = class FollowingIsFollowerSuspendedCopySuspendedState1752410900000 {
|
||||
name = 'FollowingIsFollowerSuspendedCopySuspendedState1752410900000'
|
||||
|
||||
async up(queryRunner) {
|
||||
// Update existing records based on user suspension status
|
||||
await queryRunner.query(`
|
||||
UPDATE "following"
|
||||
SET "isFollowerSuspended" = "user"."isSuspended"
|
||||
FROM "user"
|
||||
WHERE "following"."followerId" = "user"."id"
|
||||
`);
|
||||
}
|
||||
|
||||
async down(queryRunner) {
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue