[Mapbender-commits] r8401 - branches/2.7/resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Jul 2 06:25:15 PDT 2012
Author: tbaschetti
Date: 2012-07-02 06:25:15 -0700 (Mon, 02 Jul 2012)
New Revision: 8401
Modified:
branches/2.7/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql
branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.2_to_2.7.3_pgsql_UTF-8.sql
branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql
Log:
added "IF EXISTS" to DROP TABLE/VIEW/FUNCTION
to prevent error-messages during install
Modified: branches/2.7/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql
===================================================================
--- branches/2.7/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql 2012-07-02 13:07:02 UTC (rev 8400)
+++ branches/2.7/resources/db/pgsql/UTF-8/update/update_2.6.2_to_2.7rc1_pgsql_UTF-8.sql 2012-07-02 13:25:15 UTC (rev 8401)
@@ -593,8 +593,8 @@
--*****wmc adoptions****
-DROP TABLE wmc_keyword CASCADE;
-DROP TABLE wmc_md_topic_category CASCADE;
+DROP TABLE IF EXISTS wmc_keyword CASCADE;
+DROP TABLE IF EXISTS wmc_md_topic_category CASCADE;
--adopt mb_user_wmc to store a serial column too!
@@ -2197,7 +2197,7 @@
LANGUAGE 'plpgsql' VOLATILE;
--MetadataViews
-DROP VIEW search_wms_view;
+DROP VIEW IF EXISTS search_wms_view;
CREATE OR REPLACE VIEW search_wms_view AS
SELECT DISTINCT ON (wms_unref.layer_id) wms_unref.wms_id, wms_unref.availability, wms_unref.status, wms_unref.wms_title, wms_unref.wms_abstract, wms_unref.stateorprovince, wms_unref.country, wms_unref.accessconstraints, wms_unref.termsofuse, wms_unref.wms_owner, wms_unref.layer_id, wms_unref.epsg, wms_unref.layer_title, wms_unref.layer_abstract, wms_unref.layer_name, wms_unref.layer_parent, wms_unref.layer_pos, wms_unref.layer_queryable, wms_unref.load_count, wms_unref.searchtext, wms_unref.wms_timestamp, wms_unref.department, wms_unref.mb_group_name, f_collect_custom_cat_layer(wms_unref.layer_id) AS md_custom_cats, f_collect_inspire_cat_layer(wms_unref.layer_id) AS md_inspire_cats, f_collect_topic_cat_layer(wms_unref.layer_id) AS md_topic_cats, st_geometryfromtext(((((((((((((((((((('POLYGON(('::text || layer_epsg.minx::text) || ' '::text) || layer_epsg.miny::text) || ','::text) || layer_epsg.minx::text) || ' '::text) || layer_epsg.maxy::text) || ','::text) || layer_epsg.m
axx::text) || ' '::text) || layer_epsg.maxy::text) || ','::text) || layer_epsg.maxx::text) || ' '::text) || layer_epsg.miny::text) || ','::text) || layer_epsg.minx::text) || ' '::text) || layer_epsg.miny::text) || '))'::text, 4326) AS the_geom, (((((layer_epsg.minx::text || ','::text) || layer_epsg.miny::text) || ','::text) || layer_epsg.maxx::text) || ','::text) || layer_epsg.maxy::text AS bbox, wms_unref.wms_proxylog, wms_unref.wms_network_access, wms_unref.wms_pricevolume, wms_unref.mb_group_logo_path
@@ -2212,7 +2212,7 @@
WHERE layer_epsg.epsg::text = 'EPSG:4326'::text AND wms_unref.layer_id = layer_epsg.fkey_layer_id
ORDER BY wms_unref.layer_id;
-DROP VIEW search_wfs_view;
+DROP VIEW IF EXISTS search_wfs_view;
-- View: search_wfs_view
CREATE OR REPLACE VIEW search_wfs_view AS
SELECT wfs_dep.wfs_id, wfs_dep.wfs_title, wfs_dep.wfs_abstract, wfs_dep.administrativearea, wfs_dep.country, wfs_dep.accessconstraints, wfs_dep.termsofuse, wfs_dep.wfs_owner, wfs_featuretype.featuretype_id, wfs_featuretype.featuretype_srs, wfs_featuretype.featuretype_title, wfs_featuretype.featuretype_abstract, f_collect_searchtext_wfs(wfs_dep.wfs_id, wfs_featuretype.featuretype_id) AS searchtext, wfs_element.element_type, wfs_conf.wfs_conf_id, wfs_conf.wfs_conf_abstract, wfs_conf.wfs_conf_description, f_getwfsmodultype(wfs_conf.wfs_conf_id) AS modultype, wfs_dep.wfs_timestamp, wfs_dep.department, wfs_dep.mb_group_name, wfs_dep.mb_group_logo_path
@@ -2319,8 +2319,8 @@
--****wmc-begin****
-DROP FUNCTION f_collect_searchtext_wmc(character varying) CASCADE;
-DROP FUNCTION f_collect_topic_cat_wmc(character varying) CASCADE;
+DROP FUNCTION IF EXISTS f_collect_searchtext_wmc(character varying) CASCADE;
+DROP FUNCTION IF EXISTS f_collect_topic_cat_wmc(character varying) CASCADE;
-- Function: f_collect_searchtext_wmc(integer)
@@ -2392,17 +2392,18 @@
--new categories for publishing -> custom , inspire ?
-- Table: wmc_custom_category
-CREATE TABLE wmc_custom_category
-(
- fkey_wmc_serial_id integer NOT NULL,
- fkey_custom_category_id integer NOT NULL,
- CONSTRAINT wmc_custom_category_fkey_wmc_serial_id_fkey FOREIGN KEY (fkey_wmc_serial_id)
- REFERENCES mb_user_wmc (wmc_serial_id) MATCH SIMPLE
- ON UPDATE CASCADE ON DELETE CASCADE,
- CONSTRAINT wmc_custom_category_fkey_custom_category_id_fkey FOREIGN KEY (fkey_custom_category_id)
- REFERENCES custom_category (custom_category_id) MATCH SIMPLE
- ON UPDATE CASCADE ON DELETE CASCADE
-);
+-- allready done above
+-- CREATE TABLE wmc_custom_category
+-- (
+ -- fkey_wmc_serial_id integer NOT NULL,
+ -- fkey_custom_category_id integer NOT NULL,
+ -- CONSTRAINT wmc_custom_category_fkey_wmc_serial_id_fkey FOREIGN KEY (fkey_wmc_serial_id)
+ -- REFERENCES mb_user_wmc (wmc_serial_id) MATCH SIMPLE
+ -- ON UPDATE CASCADE ON DELETE CASCADE,
+ -- CONSTRAINT wmc_custom_category_fkey_custom_category_id_fkey FOREIGN KEY (fkey_custom_category_id)
+ -- REFERENCES custom_category (custom_category_id) MATCH SIMPLE
+ -- ON UPDATE CASCADE ON DELETE CASCADE
+-- );
-- Table: wmc_inspire_category
CREATE TABLE wmc_inspire_category
@@ -2485,13 +2486,8 @@
-- View: search_wmc_view
--- DROP VIEW search_wmc_view;
+DROP VIEW IF EXISTS search_wmc_view;
--TODO: get group information out of mb_group table instead of ows information, cause in this case there can be more than one different service in a resource
-
--- View: search_wmc_view
-
-DROP VIEW search_wmc_view;
---TODO: get group information out of mb_group table instead of ows information, cause in this case there can be more than one different service in a resource
--TODO: set public flag to some wmc docs to generate usefull results
--TODO: get infos from old wmc docs into table structure (abstract, coords, ...)
-- View: search_wmc_view
Modified: branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.2_to_2.7.3_pgsql_UTF-8.sql
===================================================================
--- branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.2_to_2.7.3_pgsql_UTF-8.sql 2012-07-02 13:07:02 UTC (rev 8400)
+++ branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.2_to_2.7.3_pgsql_UTF-8.sql 2012-07-02 13:25:15 UTC (rev 8401)
@@ -1,7 +1,7 @@
-- new file for db changes to 2.7.3-- new file for db changes to 2.7.3
-- replace gettext to handle ' in french translation
-DROP FUNCTION gettext(text, text);
+DROP FUNCTION IF EXISTS gettext(text, text);
CREATE OR REPLACE FUNCTION gettext(locale_arg text, string text)
RETURNS character varying AS
$BODY$
@@ -111,7 +111,7 @@
-- Function: f_count_layer_couplings(integer)
-DROP FUNCTION f_count_layer_couplings(integer);
+DROP FUNCTION IF EXISTS f_count_layer_couplings(integer);
CREATE OR REPLACE FUNCTION f_count_layer_couplings(integer)
RETURNS integer AS
$BODY$
Modified: branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql
===================================================================
--- branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql 2012-07-02 13:07:02 UTC (rev 8400)
+++ branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7rc1_to_2.7rc2_pgsql_UTF-8.sql 2012-07-02 13:25:15 UTC (rev 8401)
@@ -30,7 +30,7 @@
--
-- View: search_wmc_view
-DROP VIEW search_wmc_view;
+DROP VIEW IF EXISTS search_wmc_view;
CREATE OR REPLACE VIEW search_wmc_view AS
SELECT wmc_dep.fkey_user_id AS user_id, wmc_dep.wmc_id, wmc_dep.srs AS wmc_srs, wmc_dep.wmc_title, wmc_dep.abstract AS wmc_abstract, f_collect_searchtext_wmc(wmc_dep.wmc_id) AS searchtext, wmc_dep.wmc_timestamp, wmc_dep.department, wmc_dep.mb_group_name, wmc_dep.mb_group_title, wmc_dep.mb_group_country, wmc_dep.wmc_serial_id, f_wmc_load_count(wmc_dep.wmc_serial_id) as load_count, wmc_dep.mb_group_stateorprovince, f_collect_inspire_cat_wmc(wmc_dep.wmc_serial_id) AS md_inspire_cats, f_collect_custom_cat_wmc(wmc_dep.wmc_serial_id) AS md_custom_cats, f_collect_topic_cat_wmc(wmc_dep.wmc_id) AS md_topic_cats, st_transform(st_geometryfromtext(((((((((((((((((((('POLYGON(('::text || wmc_dep.minx::text) || ' '::text) || wmc_dep.miny::text) || ','::text) || wmc_dep.minx::text) || ' '::text) || wmc_dep.maxy::text) || ','::text) || wmc_dep.maxx::text) || ' '::text) || wmc_dep.maxy::text) || ','::text) || wmc_dep.maxx::text) || ' '::text) || wmc_dep.miny::text) || ','::text) || wmc_dep.
minx::text) || ' '::text) || wmc_dep.miny::text) || '))'::text, regexp_replace(upper(wmc_dep.srs::text), 'EPSG:'::text, ''::text)::integer), 4326) AS the_geom, (((((wmc_dep.minx::text || ','::text) || wmc_dep.miny::text) || ','::text) || wmc_dep.maxx::text) || ','::text) || wmc_dep.maxy::text AS bbox, wmc_dep.mb_group_logo_path
@@ -124,10 +124,10 @@
ALTER TABLE wfs ADD COLUMN uuid UUID;
ALTER TABLE wfs_featuretype ADD COLUMN uuid UUID;
-ALTER TABLE wms ADD COLUMN uuid character varying;
-ALTER TABLE layer ADD COLUMN uuid character varying;
-ALTER TABLE wfs ADD COLUMN uuid character varying;
-ALTER TABLE wfs_featuretype ADD COLUMN uuid character varying;
+-- ALTER TABLE wms ADD COLUMN uuid character varying;
+-- ALTER TABLE layer ADD COLUMN uuid character varying;
+-- ALTER TABLE wfs ADD COLUMN uuid character varying;
+-- ALTER TABLE wfs_featuretype ADD COLUMN uuid character varying;
-- enlarge the size of the featureinfo dialog window
More information about the Mapbender_commits
mailing list