insert skeletons migration: fix for non-local locals
authorrinpatch <rinpatch@sdf.org>
Sat, 9 May 2020 15:51:20 +0000 (18:51 +0300)
committerrinpatch <rinpatch@sdf.org>
Sat, 9 May 2020 22:09:00 +0000 (01:09 +0300)
Apparently some instances have local users with local ap_ids
that are marked as local: false. Needs more investigation into how
that happened.

In the meantime, the skeleton migration was patched to just ignore
all known ap ids, not just locals. Doesn't seem to slow down the migration
too much on patch.cx

Closes #1746

priv/repo/migrations/20200428221338_insert_skeletons_for_deleted_users.exs

index 11d9a70babaecbd9b7367044f434ecfb61e92480..2adc38186f9496a86ed6dfd59c43f161ffec0439 100644 (file)
@@ -30,7 +30,7 @@ defmodule Pleroma.Repo.Migrations.InsertSkeletonsForDeletedUsers do
           Repo,
           "select distinct unnest(nonexistent_locals.recipients) from activities, lateral (select array_agg(recipient) as recipients from unnest(activities.recipients) as recipient where recipient similar to '#{
             instance_uri
-          }/users/[A-Za-z0-9]*' and not(recipient in (select ap_id from users where local = true))) nonexistent_locals;",
+          }/users/[A-Za-z0-9]*' and not(recipient in (select ap_id from users))) nonexistent_locals;",
           [],
           timeout: :infinity
         )