-- 
-- Set Sequence for serial values
--

SELECT pg_catalog.setval('gui_treegde_id_seq', (Select max(id) from gui_treegde), true);

SELECT pg_catalog.setval('layer_layer_id_seq', (Select max(layer_id) from layer), true);

SELECT pg_catalog.setval('mb_group_mb_group_id_seq', (Select max(mb_group_id) from mb_group), true);

SELECT pg_catalog.setval('mb_log_id_seq', (Select max(id) from mb_log), true);

SELECT pg_catalog.setval('mb_user_mb_user_id_seq', (Select max(mb_user_id) from mb_user), true);

SELECT pg_catalog.setval('wfs_wfs_id_seq', (Select max(wfs_id) from wfs), true);

SELECT pg_catalog.setval('wfs_conf_wfs_conf_id_seq', (Select max(wfs_conf_id) from wfs_conf), true);

SELECT pg_catalog.setval('wfs_conf_element_wfs_conf_element_id_seq', (Select max(wfs_conf_element_id) from wfs_conf_element), true);

SELECT pg_catalog.setval('wfs_element_element_id_seq', (Select max(element_id) from wfs_element), true);

SELECT pg_catalog.setval('wfs_featuretype_featuretype_id_seq', (Select max(featuretype_id) from wfs_featuretype), true);


SELECT pg_catalog.setval('wms_wms_id_seq', (Select max(wms_id) from wms), true);

-- new sequences from Mapbender version 2.4.1
SELECT pg_catalog.setval('keyword_id_seq', (Select max(keyword_id) from keyword), true);
SELECT pg_catalog.setval('md_topic_category_id_seq', (Select max(md_topic_category_id) from md_topic_category), true);

-- new sequences from Mapbender version 2.5
SELECT pg_catalog.setval('trs_id_seq', (Select max(trs_id) from translations), true);
SELECT pg_catalog.setval('kml_id_seq', (Select max(kml_id) from gui_kml), true);

SELECT pg_catalog.setval('sld_user_layer_id_seq', (Select max(sld_user_layer_id) from sld_user_layer), true);

