[Mapbender-dev] Missing constraint

Christoph Baudson christoph.baudson at wheregroup.com
Mon Mar 16 13:24:04 EDT 2009


Christoph Baudson schrieb:
> When trying to solve the WFS update bug, I found out that a constraint 
> was missing in the database: The foreign key constraint linking 
> element_id in wfs_element to f_id in wfs_conf_element.
>
> I will add this to the update SQLs of Mapbender 2.5.1, so it will be 
> automatically included in 2.6

Unfortunately my database is so messed up with data inconsistencies that 
I can't add the constraint so easily.

First, I would have to delete the obsolete configured featuretype 
elements in wfs_conf_element.

DELETE FROM wfs_conf_element WHERE f_id = ((SELECT DISTINCT f_id FROM 
wfs_conf_element) EXCEPT (SELECT DISTINCT f_id FROM wfs_conf_element, 
wfs_element WHERE f_id = element_id))


Then I could add the constraint

ALTER TABLE ONLY wfs_conf_element
    ADD CONSTRAINT wfs_conf_element_id_ibfk_1 FOREIGN KEY (f_id) 
REFERENCES wfs_element (element_id) ON UPDATE CASCADE ON DELETE CASCADE;





>
> Please take better care next time when adding new tables to Mapbender.
>
> Thanks
>
> Christoph
>


-- 

----------------------------------

 FOSSGIS Konferenz 2009
 17.-19. März 2009 in Hannover
 http://www.fossgis.de/konferenz

---------------------------------- 

_______________________________________

W h e r e G r o u p GmbH & Co. KG

Siemensstraße 8
53121 Bonn
Germany

Christoph Baudson
Anwendungsentwickler

Fon: +49 (0)228 / 90 90 38 - 15
Fax: +49 (0)228 / 90 90 38 - 11
christoph.baudson at wheregroup.com
www.wheregroup.com
Amtsgericht Bonn, HRA 6788
_______________________________________

Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm
_______________________________________



More information about the Mapbender_dev mailing list