mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-25 22:01:19 +00:00
Update replaceable_schema.sql
This commit is contained in:
parent
b333988882
commit
c0acb474ac
1 changed files with 6 additions and 8 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue