mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-10-01 01:36:12 -04:00
Update replaceable_schema.sql
This commit is contained in:
parent
5606a8c6cf
commit
3b4712d42f
@ -65,6 +65,27 @@ CREATE TRIGGER aggregates
|
|||||||
FOR EACH STATEMENT
|
FOR EACH STATEMENT
|
||||||
EXECUTE FUNCTION r.community_aggregates_from_community ();
|
EXECUTE FUNCTION r.community_aggregates_from_community ();
|
||||||
|
|
||||||
|
CREATE FUNCTION person_aggregates_from_person ()
|
||||||
|
RETURNS trigger
|
||||||
|
LANGUAGE plpgsql
|
||||||
|
AS $$
|
||||||
|
BEGIN
|
||||||
|
INSERT INTO person_aggregates (person_id)
|
||||||
|
SELECT
|
||||||
|
id,
|
||||||
|
FROM
|
||||||
|
new_person;
|
||||||
|
|
||||||
|
RETURN NULL;
|
||||||
|
END
|
||||||
|
$$;
|
||||||
|
|
||||||
|
CREATE TRIGGER aggregates
|
||||||
|
AFTER INSERT ON person
|
||||||
|
REFERENCING NEW TABLE AS new_person
|
||||||
|
FOR EACH STATEMENT
|
||||||
|
EXECUTE FUNCTION r.person_aggregates_from_person ();
|
||||||
|
|
||||||
CREATE FUNCTION r.post_aggregates_from_post ()
|
CREATE FUNCTION r.post_aggregates_from_post ()
|
||||||
RETURNS trigger
|
RETURNS trigger
|
||||||
LANGUAGE plpgsql
|
LANGUAGE plpgsql
|
||||||
|
Loading…
Reference in New Issue
Block a user