From 39dba5a0ccbbe3afa489db1a848f50c60ad56c50 Mon Sep 17 00:00:00 2001 From: APTX Date: Thu, 25 Apr 2013 02:42:16 +0200 Subject: [PATCH] Notify rename_data_changed on updates as well as inserts. --- localmylist/share/schema/schema.sql | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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); -- 2.52.0