[Mapbender-commits] r9460 - trunk/mapbender/resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue May 17 01:22:03 PDT 2016
Author: armin11
Date: 2016-05-17 01:22:03 -0700 (Tue, 17 May 2016)
New Revision: 9460
Modified:
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
Log:
Cast value of time reference to date from timestamp
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 2016-05-13 10:09:50 UTC (rev 9459)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2016-05-17 08:22:03 UTC (rev 9460)
@@ -942,7 +942,7 @@
CREATE OR REPLACE VIEW search_dataset_view AS
-SELECT DISTINCT ON (metadata_id) * FROM ( SELECT dataset_dep.fkey_mb_user_id AS user_id, dataset_dep.dataset_id, dataset_dep.dataset_id AS metadata_id, dataset_dep.srs AS dataset_srs, dataset_dep.title, dataset_dep.abstract AS dataset_abstract, dataset_dep.accessconstraints, dataset_dep.isopen, dataset_dep.termsofuse, f_collect_searchtext_dataset(dataset_dep.dataset_id) AS searchtext, dataset_dep.dataset_timestamp, dataset_dep.department, dataset_dep.mb_group_name, dataset_dep.mb_group_title, dataset_dep.mb_group_country, CASE WHEN load_count IS NULL THEN 0 ELSE load_count END as load_count, dataset_dep.mb_group_stateorprovince, f_collect_inspire_cat_dataset(dataset_dep.dataset_id) AS md_inspire_cats, f_collect_custom_cat_dataset(dataset_dep.dataset_id) AS md_custom_cats, f_collect_topic_cat_dataset(dataset_dep.dataset_id) AS md_topic_cats, dataset_dep.bbox AS the_geom, (((((st_xmin(dataset_dep.bbox::box3d)::text || ','::text) || st_ymin(dataset_dep.bbox::box3d)::text) || ','::text)
|| st_xmax(dataset_dep.bbox::box3d)::text) || ','::text) || st_ymax(dataset_dep.bbox::box3d)::text AS bbox, dataset_dep.preview_url, dataset_dep.fileidentifier, f_get_coupled_resources(dataset_dep.dataset_id) AS coupled_resources, dataset_dep.mb_group_logo_path, dataset_dep.timebegin, CASE WHEN update_frequency = 'continual' THEN now() WHEN update_frequency = 'daily' THEN now() WHEN update_frequency = 'weekly' THEN now() - interval '7 day' WHEN update_frequency = 'fortnightly' THEN now() - interval '14 day' WHEN update_frequency = 'monthly' THEN now() -interval '1 month' WHEN update_frequency = 'quarterly' THEN now() - interval '3 month' WHEN update_frequency = 'biannually' THEN now() - interval '6 month' WHEN update_frequency = 'annually' THEN now() - interval '12 month' ELSE dataset_dep.timeend END AS timeend
+SELECT DISTINCT ON (metadata_id) * FROM ( SELECT dataset_dep.fkey_mb_user_id AS user_id, dataset_dep.dataset_id, dataset_dep.dataset_id AS metadata_id, dataset_dep.srs AS dataset_srs, dataset_dep.title, dataset_dep.abstract AS dataset_abstract, dataset_dep.accessconstraints, dataset_dep.isopen, dataset_dep.termsofuse, f_collect_searchtext_dataset(dataset_dep.dataset_id) AS searchtext, dataset_dep.dataset_timestamp, dataset_dep.department, dataset_dep.mb_group_name, dataset_dep.mb_group_title, dataset_dep.mb_group_country, CASE WHEN load_count IS NULL THEN 0 ELSE load_count END as load_count, dataset_dep.mb_group_stateorprovince, f_collect_inspire_cat_dataset(dataset_dep.dataset_id) AS md_inspire_cats, f_collect_custom_cat_dataset(dataset_dep.dataset_id) AS md_custom_cats, f_collect_topic_cat_dataset(dataset_dep.dataset_id) AS md_topic_cats, dataset_dep.bbox AS the_geom, (((((st_xmin(dataset_dep.bbox::box3d)::text || ','::text) || st_ymin(dataset_dep.bbox::box3d)::text) || ','::text)
|| st_xmax(dataset_dep.bbox::box3d)::text) || ','::text) || st_ymax(dataset_dep.bbox::box3d)::text AS bbox, dataset_dep.preview_url, dataset_dep.fileidentifier, f_get_coupled_resources(dataset_dep.dataset_id) AS coupled_resources, dataset_dep.mb_group_logo_path, dataset_dep.timebegin::date, CASE WHEN update_frequency = 'continual' THEN now()::date WHEN update_frequency = 'daily' THEN now()::date WHEN update_frequency = 'weekly' THEN (now() - interval '7 day')::date WHEN update_frequency = 'fortnightly' THEN (now() - interval '14 day')::date WHEN update_frequency = 'monthly' THEN (now() -interval '1 month')::date WHEN update_frequency = 'quarterly' THEN (now() - interval '3 month')::date WHEN update_frequency = 'biannually' THEN (now() - interval '6 month')::date WHEN update_frequency = 'annually' THEN (now() - interval '12 month')::date ELSE dataset_dep.timeend::date END AS timeend
FROM ( SELECT mb_metadata.the_geom AS bbox, mb_metadata.ref_system AS srs, mb_metadata.metadata_id AS dataset_id, mb_metadata.title, mb_metadata.abstract, mb_metadata.lastchanged AS dataset_timestamp, mb_metadata.tmp_reference_1 as timeBegin, mb_metadata.tmp_reference_2 as timeEnd, mb_metadata.uuid AS fileidentifier, mb_metadata.preview_image AS preview_url, mb_metadata.load_count as load_count, mb_metadata.fkey_mb_user_id, mb_metadata.constraints as accessconstraints,mb_metadata.update_frequency as update_frequency, f_getmd_tou(mb_metadata.metadata_id) AS termsofuse, f_tou_isopen(f_getmd_tou(mb_metadata.metadata_id)) AS isopen, user_dep.mb_group_id AS department, user_dep.mb_group_name, user_dep.mb_group_title, user_dep.mb_group_country, user_dep.mb_group_stateorprovince, user_dep.mb_group_logo_path
FROM ( SELECT registrating_groups.fkey_mb_user_id AS mb_user_id, mb_group.mb_group_id, mb_group.mb_group_name, mb_group.mb_group_title, mb_group.mb_group_country, mb_group.mb_group_stateorprovince, mb_group.mb_group_logo_path
FROM registrating_groups, mb_group
More information about the Mapbender_commits
mailing list