mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-29 07:41:20 +00:00
Update replaceable_schema.sql
This commit is contained in:
parent
a4fdd325a3
commit
bc10ef69af
1 changed files with 12 additions and 0 deletions
|
@ -82,6 +82,18 @@ CALL r.resolve_reports_when_target_removed ('post');
|
||||||
-- These triggers create and update rows in each aggregates table to match its associated table's rows.
|
-- These triggers create and update rows in each aggregates table to match its associated table's rows.
|
||||||
-- Deleting rows and updating IDs are already handled by `CASCADE` in foreign key constraints.
|
-- Deleting rows and updating IDs are already handled by `CASCADE` in foreign key constraints.
|
||||||
|
|
||||||
|
CALL r.upsert_aggregates ('comment', 'published', NULL);
|
||||||
|
|
||||||
|
CALL r.upsert_aggregates ('community', 'published', NULL);
|
||||||
|
|
||||||
|
CALL r.upsert_aggregates ('person', NULL, NULL);
|
||||||
|
|
||||||
|
CALL r.upsert_aggregates (
|
||||||
|
'post',
|
||||||
|
'published, newest_comment_time, newest_comment_time_necro, community_id, creator_id, instance_id, featured_community, featured_local',
|
||||||
|
'published AS newest_comment_time, published AS newest_comment_time_necro, (SELECT community.instance_id FROM community WHERE community.id = community_id LIMIT 1) AS instance_id'
|
||||||
|
);
|
||||||
|
|
||||||
CREATE FUNCTION r.comment_aggregates_from_comment ()
|
CREATE FUNCTION r.comment_aggregates_from_comment ()
|
||||||
RETURNS trigger
|
RETURNS trigger
|
||||||
LANGUAGE plpgsql
|
LANGUAGE plpgsql
|
||||||
|
|
Loading…
Reference in a new issue