projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'develop' into admin-be
[akkoma]
/
priv
/
repo
/
migrations
/
20191008132217_migrate_following_relationships.exs
diff --git
a/priv/repo/migrations/20191008132217_migrate_following_relationships.exs
b/priv/repo/migrations/20191008132217_migrate_following_relationships.exs
index c9bc890aa4a6ae7af99377ab0c2728497fd048ae..9d5c2648f7202737d11db2bd62a51f5ef4b187fc 100644
(file)
--- a/
priv/repo/migrations/20191008132217_migrate_following_relationships.exs
+++ b/
priv/repo/migrations/20191008132217_migrate_following_relationships.exs
@@
-55,7
+55,6
@@
defmodule Pleroma.Repo.Migrations.MigrateFollowingRelationships do
WHERE
activities.data ->> 'type' = 'Follow'
AND activities.data ->> 'state' IN ('accept', 'pending', 'reject')
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
"""
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
updated_at = now()
FROM (
SELECT
- follwer.id AS follower_id,
- CASE follwer.local
+ foll
o
wer.id AS follower_id,
+ CASE foll
o
wer.local
WHEN TRUE THEN
WHEN TRUE THEN
- array_prepend(follwer.follower_address, array_agg(following.follower_address))
+ array_prepend(foll
o
wer.follower_address, array_agg(following.follower_address))
ELSE
array_agg(following.follower_address)
END AS following_array
FROM
following_relationships
ELSE
array_agg(following.follower_address)
END AS following_array
FROM
following_relationships
- JOIN users AS foll
wer ON foll
wer.id = following_relationships.follower_id
- JOIN users AS
FOLLOWING
ON following.id = following_relationships.following_id
+ JOIN users AS foll
ower ON follo
wer.id = following_relationships.follower_id
+ JOIN users AS
following
ON following.id = following_relationships.following_id
GROUP BY
GROUP BY
- follwer.id) AS following_query
+ foll
o
wer.id) AS following_query
WHERE
following_query.follower_id = users.id
"""
WHERE
following_query.follower_id = users.id
"""