[Mapbender-commits] r9862 - trunk/mapbender/resources/db/pgsql/UTF-8/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Feb 7 09:10:00 PST 2018


Author: armin11
Date: 2018-02-07 09:10:00 -0800 (Wed, 07 Feb 2018)
New Revision: 9862

Modified:
   trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
Log:
Fix database trigger for monitoring ows

Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql	2018-02-06 18:09:00 UTC (rev 9861)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql	2018-02-07 17:10:00 UTC (rev 9862)
@@ -2227,9 +2227,6 @@
 ALTER TABLE mb_wms_availability ADD COLUMN monitor_count integer;
 
 -- Function: mb_monitor_after()
-
--- DROP FUNCTION mb_monitor_after();
-
 CREATE OR REPLACE FUNCTION mb_monitor_after()
   RETURNS trigger AS
 $BODY$DECLARE
@@ -2271,14 +2268,14 @@
 		IF (select count(fkey_wms_id) from mb_wms_availability where fkey_wms_id=NEW.fkey_wms_id) > 0  THEN -- service is not new
 			UPDATE mb_wms_availability set fkey_upload_id=NEW.upload_id,last_status=NEW.status,status_comment=NEW.status_comment,upload_url=NEW.upload_url, cap_diff=NEW.cap_diff where fkey_wms_id=NEW.fkey_wms_id;
 		ELSE --service has not yet been monitored
-			INSERT INTO mb_wms_availability (fkey_upload_id,fkey_wms_id,last_status,status_comment,upload_url,map_url,cap_diff,average_resp_time,availability,monitor_count) VALUES (NEW.upload_id,NEW.fkey_wms_id,NEW.status,NEW.status_comment,NEW.upload_url::text,NEW.map_url,NEW.cap_diff,0,100,count_monitor::INTEGER);
+			INSERT INTO mb_wms_availability (fkey_upload_id,fkey_wms_id,last_status,status_comment,upload_url,map_url,cap_diff,average_resp_time,availability,monitor_count) VALUES (NEW.upload_id,NEW.fkey_wms_id,NEW.status,NEW.status_comment,NEW.upload_url::text,NEW.map_url,NEW.cap_diff,0,100,0);
 		END IF;
 	ELSE
 		IF NEW.fkey_wfs_id IS NOT NULL THEN
 			IF (select count(fkey_wfs_id) from mb_wfs_availability where fkey_wfs_id=NEW.fkey_wfs_id) > 0  then -- service is not new
 				UPDATE mb_wfs_availability set fkey_upload_id=NEW.upload_id,last_status=NEW.status,status_comment=NEW.status_comment,upload_url=NEW.upload_url, cap_diff=NEW.cap_diff where fkey_wfs_id=NEW.fkey_wfs_id;
 			ELSE --service has not yet been monitored
-				INSERT INTO mb_wfs_availability (fkey_upload_id,fkey_wfs_id,last_status,status_comment,upload_url,feature_urls,cap_diff,average_resp_time,availability,monitor_count) VALUES (NEW.upload_id,NEW.fkey_wfs_id,NEW.status,NEW.status_comment,NEW.upload_url::text,NEW.feature_urls,NEW.cap_diff,0,100,count_monitor::INTEGER);
+				INSERT INTO mb_wfs_availability (fkey_upload_id,fkey_wfs_id,last_status,status_comment,upload_url,feature_urls,cap_diff,average_resp_time,availability,monitor_count) VALUES (NEW.upload_id,NEW.fkey_wfs_id,NEW.status,NEW.status_comment,NEW.upload_url::text,NEW.feature_urls,NEW.cap_diff,0,100,0);
 			END IF;
 		END IF;
 	END IF;	



More information about the Mapbender_commits mailing list