Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Commit

Permalink
Include ignored .sql-files, again...
Browse files Browse the repository at this point in the history
  • Loading branch information
ahultgren committed Apr 16, 2015
1 parent dfffb54 commit abd94a8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/query/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!*.sql
11 changes: 11 additions & 0 deletions app/query/createNotifier.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
CREATE OR REPLACE FUNCTION notify_new_event() RETURNS trigger AS $$
DECLARE
BEGIN
PERFORM pg_notify('watchers', NEW.type || '|' || NEW.id);
RETURN new;
END;
$$ LANGUAGE plpgsql;

DROP TRIGGER IF EXISTS new_event ON events;
CREATE TRIGGER new_event AFTER INSERT ON events
FOR EACH ROW EXECUTE PROCEDURE notify_new_event();

0 comments on commit abd94a8

Please sign in to comment.