mirror of
https://github.com/LemmyNet/lemmy.git
synced 2025-01-03 16:51:35 +00:00
Fixing duped trigger.
This commit is contained in:
parent
a1792bb16e
commit
cfd302dc1d
1 changed files with 0 additions and 32 deletions
|
@ -761,35 +761,3 @@ CALL r.create_person_saved_combined_trigger ('post');
|
||||||
|
|
||||||
CALL r.create_person_saved_combined_trigger ('comment');
|
CALL r.create_person_saved_combined_trigger ('comment');
|
||||||
|
|
||||||
-- Combined tables triggers
|
|
||||||
-- These insert (published, item_id) into X_combined tables
|
|
||||||
-- Reports (comment_report, post_report, private_message_report)
|
|
||||||
CREATE PROCEDURE r.create_report_combined_trigger (table_name text)
|
|
||||||
LANGUAGE plpgsql
|
|
||||||
AS $a$
|
|
||||||
BEGIN
|
|
||||||
EXECUTE replace($b$ CREATE FUNCTION r.report_combined_thing_insert ( )
|
|
||||||
RETURNS TRIGGER
|
|
||||||
LANGUAGE plpgsql
|
|
||||||
AS $$
|
|
||||||
BEGIN
|
|
||||||
INSERT INTO report_combined (published, thing_id)
|
|
||||||
VALUES (NEW.published, NEW.id);
|
|
||||||
RETURN NEW;
|
|
||||||
END $$;
|
|
||||||
CREATE TRIGGER report_combined
|
|
||||||
AFTER INSERT ON thing
|
|
||||||
FOR EACH ROW
|
|
||||||
EXECUTE FUNCTION r.report_combined_thing_insert ( );
|
|
||||||
$b$,
|
|
||||||
'thing',
|
|
||||||
table_name);
|
|
||||||
END;
|
|
||||||
$a$;
|
|
||||||
|
|
||||||
CALL r.create_report_combined_trigger ('post_report');
|
|
||||||
|
|
||||||
CALL r.create_report_combined_trigger ('comment_report');
|
|
||||||
|
|
||||||
CALL r.create_report_combined_trigger ('private_message_report');
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue