Skip deactivated users in followers import
authorEgor Kislitsyn <egor@kislitsyn.com>
Mon, 14 Oct 2019 07:16:57 +0000 (14:16 +0700)
committerEgor Kislitsyn <egor@kislitsyn.com>
Mon, 14 Oct 2019 07:16:57 +0000 (14:16 +0700)
priv/repo/migrations/20191008132217_migrate_following_relationships.exs

index 7f996f5a5054d6c7da8f16bcc5d1f8b8d6dd7826..c9bc890aa4a6ae7af99377ab0c2728497fd048ae 100644 (file)
@@ -55,6 +55,7 @@ defmodule Pleroma.Repo.Migrations.MigrateFollowingRelationships do
     WHERE
         activities.data ->> 'type' = 'Follow'
         AND activities.data ->> 'state' IN ('accept', 'pending', 'reject')
+        AND NOT (followers.info ? 'deactivated' AND followers.info -> 'deactivated' @> 'true')
     ORDER BY activities.updated_at DESC
     ON CONFLICT DO NOTHING
     """