Update replaceable_schema.sql

This commit is contained in:
dullbananas 2023-12-28 19:18:03 -07:00 committed by GitHub
parent 1ff9c6f06c
commit 6477b6d2df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;