updated londiste.upgrade_schema with fix for londiste.table_info trigger issue
authormartinko <gamato@users.sf.net>
Sat, 7 Dec 2013 15:15:44 +0000 (16:15 +0100)
committermartinko <gamato@users.sf.net>
Sat, 7 Dec 2013 15:15:44 +0000 (16:15 +0100)
sql/londiste/functions/londiste.upgrade_schema.sql

index a0cf11e269c98feaea2b69283b9b826f3c38ce60..508daea2b474fd723ef401d8f666fd9fb3b8b8a4 100644 (file)
@@ -28,6 +28,18 @@ begin
         alter table londiste.table_info add column dest_table text;
     end if;
 
+    -- table_info: change trigger timing
+    perform 1 from information_schema.triggers
+      where event_object_schema = 'londiste'
+        and event_object_table = 'table_info'
+        and trigger_name = 'table_info_trigger_sync'
+        and condition_timing = 'AFTER';
+    if found then
+        drop trigger table_info_trigger_sync on londiste.table_info;
+        create trigger table_info_trigger_sync before delete on londiste.table_info
+            for each row execute procedure londiste.table_info_trigger();
+    end if;
+
     -- applied_execute.dest_table
     perform 1 from information_schema.columns
       where table_schema = 'londiste'