]> Some of my projects - localmylist.git/commitdiff
Notify rename_data_changed on updates as well as inserts.
authorAPTX <marek321@gmail.com>
Thu, 25 Apr 2013 00:42:16 +0000 (02:42 +0200)
committerAPTX <marek321@gmail.com>
Thu, 25 Apr 2013 00:42:16 +0000 (02:42 +0200)
localmylist/share/schema/schema.sql

index 7432545198ab37f66a6edbca73e236354427f54a..c7743a0d6ac8ff390f61c362d32d80c105d5fc8a 100644 (file)
@@ -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);