Add changelog entry for hashtag following
[akkoma] / priv / repo / migrations / 20191008132217_migrate_following_relationships.exs
index c9bc890aa4a6ae7af99377ab0c2728497fd048ae..9d5c2648f7202737d11db2bd62a51f5ef4b187fc 100644 (file)
@@ -55,7 +55,6 @@ 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
     """
@@ -70,19 +69,19 @@ defmodule Pleroma.Repo.Migrations.MigrateFollowingRelationships do
         updated_at = now()
     FROM (
         SELECT
-            follwer.id AS follower_id,
-            CASE follwer.local
+            follower.id AS follower_id,
+            CASE follower.local
             WHEN TRUE THEN
-                array_prepend(follwer.follower_address, array_agg(following.follower_address))
+                array_prepend(follower.follower_address, array_agg(following.follower_address))
             ELSE
                 array_agg(following.follower_address)
             END AS following_array
         FROM
             following_relationships
-            JOIN users AS follwer ON follwer.id = following_relationships.follower_id
-            JOIN users AS FOLLOWING ON following.id = following_relationships.following_id
+            JOIN users AS follower ON follower.id = following_relationships.follower_id
+            JOIN users AS following ON following.id = following_relationships.following_id
         GROUP BY
-            follwer.id) AS following_query
+            follower.id) AS following_query
     WHERE
         following_query.follower_id = users.id
     """