mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 13:51:19 +00:00
Update replaceable_schema.sql
This commit is contained in:
parent
1ff9c6f06c
commit
6477b6d2df
1 changed files with 8 additions and 8 deletions
|
@ -351,7 +351,7 @@ BEGIN
|
||||||
communities = a.communities + diff.communities
|
communities = a.communities + diff.communities
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
sum(change_diff) AS communities
|
sum(count_diff) AS communities
|
||||||
FROM
|
FROM
|
||||||
r.combine_transition_tables () AS (count_diff bigint, community community)
|
r.combine_transition_tables () AS (count_diff bigint, community community)
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -375,11 +375,11 @@ BEGIN
|
||||||
users = a.users + diff.users
|
users = a.users + diff.users
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
sum(change_diff) AS users
|
sum(count_diff) AS users
|
||||||
FROM
|
FROM
|
||||||
r.combine_transition_tables () AS (count_diff bigint,
|
r.combine_transition_tables () AS (count_diff bigint, person person)
|
||||||
WHERE
|
WHERE
|
||||||
local) AS diff;
|
(person).local) AS diff;
|
||||||
RETURN NULL;
|
RETURN NULL;
|
||||||
END
|
END
|
||||||
$$;
|
$$;
|
||||||
|
@ -445,20 +445,20 @@ BEGIN
|
||||||
subscriber = a.subscribers + diff.subscribers
|
subscriber = a.subscribers + diff.subscribers
|
||||||
FROM (
|
FROM (
|
||||||
SELECT
|
SELECT
|
||||||
community_id,
|
(community_follower).community_id,
|
||||||
sum(count_diff) AS subscribers
|
sum(count_diff) AS subscribers
|
||||||
FROM
|
FROM
|
||||||
r.combine_transition_tables ()
|
r.combine_transition_tables () AS (count_diff bigint, community_follower community_follower)
|
||||||
WHERE (
|
WHERE (
|
||||||
SELECT
|
SELECT
|
||||||
local
|
local
|
||||||
FROM
|
FROM
|
||||||
community
|
community
|
||||||
WHERE
|
WHERE
|
||||||
community.id = community_id
|
community.id = (community_follower).community_id
|
||||||
LIMIT 1)
|
LIMIT 1)
|
||||||
GROUP BY
|
GROUP BY
|
||||||
community_id) AS diff
|
(community_follower).community_id) AS diff
|
||||||
WHERE
|
WHERE
|
||||||
a.community_id = diff.community_id;
|
a.community_id = diff.community_id;
|
||||||
RETURN NULL;
|
RETURN NULL;
|
||||||
|
|
Loading…
Reference in a new issue