diff --git a/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py b/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py index 76a0f951..ca4c7d32 100644 --- a/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py +++ b/migrations/versions/26138ecda7c3_unique_user_ap_profile_id.py @@ -67,8 +67,8 @@ def upgrade(): conn.execute(text('UPDATE "community" SET user_id = :new_id WHERE user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) conn.execute(text('UPDATE "domain_block" SET user_id = :new_id WHERE user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) conn.execute(text('UPDATE "community_block" SET user_id = :new_id WHERE user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) - conn.execute(text('UPDATE "user_follower" SET local_user_id = :new_id WHERE local_user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) - conn.execute(text('UPDATE "user_follower" SET remote_user_id = :new_id WHERE remote_user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) + conn.execute(text('DELETE FROM "user_follower" WHERE local_user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) + conn.execute(text('DELETE FROM "user_follower" WHERE remote_user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) conn.execute(text('UPDATE "community_ban" SET user_id = :new_id WHERE user_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) conn.execute(text('UPDATE "user_note" SET target_id = :new_id WHERE target_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)}) conn.execute(text('UPDATE "user_block" SET blocked_id = :new_id WHERE blocked_id IN :old_ids'), {"new_id": new_id, "old_ids": tuple(old_ids)})