Merge pull request #4112 from pixelfed/staging

Update FixDuplicateProfiles command
This commit is contained in:
daniel 2023-01-21 08:50:42 -07:00 committed by GitHub
commit 2990f46cd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,8 +155,20 @@ class FixDuplicateProfiles extends Command
protected function checkFollowers($id, $oid)
{
Follower::whereProfileId($oid)->where('profile_id', '!=', $id)->update(['profile_id' => $id]);
Follower::whereFollowingId($oid)->where('following_id', '!=', $id)->update(['following_id' => $id]);
$f = Follower::whereProfileId($oid)->pluck('following_id');
foreach($f as $fo) {
Follower::updateOrCreate([
'profile_id' => $id,
'following_id' => $fo
]);
}
$f = Follower::whereFollowingId($oid)->pluck('profile_id');
foreach($f as $fo) {
Follower::updateOrCreate([
'profile_id' => $fo,
'following_id' => $id
]);
}
}
protected function checkHashtagFollow($id, $oid)