From: APTX Date: Thu, 25 Apr 2013 00:42:16 +0000 (+0200) Subject: Notify rename_data_changed on updates as well as inserts. X-Git-Url: https://gitweb.tyo.aptx.org/?a=commitdiff_plain;h=39dba5a0ccbbe3afa489db1a848f50c60ad56c50;p=localmylist.git Notify rename_data_changed on updates as well as inserts. --- diff --git a/localmylist/share/schema/schema.sql b/localmylist/share/schema/schema.sql index 7432545..c7743a0 100644 --- a/localmylist/share/schema/schema.sql +++ b/localmylist/share/schema/schema.sql @@ -341,16 +341,21 @@ CREATE OR REPLACE RULE file_location_insert_notify_rule AS -- Update rules CREATE OR REPLACE RULE anime_update_notify_rule AS - ON UPDATE TO anime DO SELECT pg_notify('anime_update', new.aid::text); + ON UPDATE TO anime DO SELECT pg_notify('rename_data_changed', ''), + pg_notify('anime_update', new.aid::text); CREATE OR REPLACE RULE episode_update_notify_rule AS - ON UPDATE TO episode DO SELECT pg_notify('episode_update', new.eid::text || ',' || new.aid::text); + ON UPDATE TO episode DO SELECT pg_notify('rename_data_changed', ''), + pg_notify('episode_update', new.eid::text || ',' || new.aid::text); CREATE OR REPLACE RULE file_update_notify_rule AS - ON UPDATE TO file DO SELECT pg_notify('file_update', new.fid::text || ',' || new.eid::text || ',' || new.aid::text); + ON UPDATE TO file DO SELECT pg_notify('rename_data_changed', ''), + pg_notify('file_update', new.fid::text || ',' || new.eid::text || ',' || new.aid::text); CREATE OR REPLACE RULE file_location_update_notify_rule AS - ON UPDATE TO file_location DO SELECT pg_notify('file_location_update', new.location_id::text || ',' || new.fid::text); + ON UPDATE TO file_location DO SELECT pg_notify('rename_data_changed', ''), + pg_notify('file_location_update', new.location_id::text || ',' || new.fid::text); +-- Delete rules CREATE OR REPLACE RULE file_location_delete_notify_rule AS ON DELETE TO file_location DO SELECT pg_notify('file_location_delete', old.location_id::text || ',' || old.fid::text);