Squash price feed trigger update into original migration
This commit is contained in:
parent
99dc12c1fd
commit
929643132a
@ -2,7 +2,8 @@ CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$
|
||||
BEGIN
|
||||
PERFORM pg_notify(
|
||||
CAST('postgraphile:price_feed' AS text),
|
||||
row_to_json(NEW)::text);
|
||||
json_build_object('__node__', json_build_array('price_feeds', NEW.id))::text
|
||||
);
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
@ -1,15 +0,0 @@
|
||||
DROP TRIGGER notify_pricefeeds ON maker.price_feeds;
|
||||
|
||||
CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$
|
||||
BEGIN
|
||||
PERFORM pg_notify(
|
||||
CAST('postgraphile:price_feed' AS text),
|
||||
row_to_json(NEW)::text);
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE TRIGGER notify_pricefeeds
|
||||
AFTER INSERT ON maker.price_feeds
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE notify_pricefeed();
|
@ -1,16 +0,0 @@
|
||||
DROP TRIGGER notify_pricefeeds ON maker.price_feeds;
|
||||
|
||||
CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$
|
||||
BEGIN
|
||||
PERFORM pg_notify(
|
||||
CAST('postgraphile:price_feed' AS text),
|
||||
json_build_object('__node__', json_build_array('price_feeds', NEW.id))::text
|
||||
);
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
||||
|
||||
CREATE TRIGGER notify_pricefeeds
|
||||
AFTER INSERT ON maker.price_feeds
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE notify_pricefeed();
|
Loading…
Reference in New Issue
Block a user