Update replaceable_schema.sql

This commit is contained in:
dullbananas 2023-12-23 09:28:12 -07:00 committed by GitHub
parent b333988882
commit c0acb474ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,7 @@ DROP SCHEMA IF EXISTS r CASCADE;
CREATE SCHEMA r; CREATE SCHEMA r;
-- These triggers resolve an item's reports when the item is removed. -- These triggers resolve an item's reports when the item is marked as removed.
CREATE FUNCTION resolve_reports_when_post_removed () RETURNS trigger CREATE FUNCTION resolve_reports_when_post_removed () RETURNS trigger
LANGUAGE plpgsql LANGUAGE plpgsql
@ -157,11 +157,10 @@ BEGIN
1 1
FROM FROM
site_aggregates) THEN site_aggregates) THEN
INSERT INTO site_aggregates (site_id) INSERT INTO
SELECT site_aggregates (site_id)
id, VALUES
FROM (NEW.id);
new_site;
RETURN NULL; RETURN NULL;
END END
@ -169,8 +168,7 @@ $$;
CREATE TRIGGER aggregates CREATE TRIGGER aggregates
AFTER INSERT ON site AFTER INSERT ON site
REFERENCING NEW TABLE AS new_site FOR EACH ROW
FOR EACH STATEMENT
EXECUTE FUNCTION r.site_aggregates_from_site (); EXECUTE FUNCTION r.site_aggregates_from_site ();
COMMIT; COMMIT;