Fix the_geom_webmercator already exists #141

This commit is contained in:
Rafa de la Torre 2015-09-14 17:05:59 +02:00
parent e3bba2ee4b
commit 731ee0a9ba

View File

@ -835,6 +835,8 @@ BEGIN
-- If mercgeom is the wrong name, just rename it.
IF has_mercgeom AND has_mercgeom_name != const.mercgeomcol THEN
sql := Format('ALTER TABLE %I DROP COLUMN IF EXISTS %I', reloid::text, const.mercgeomcol);
PERFORM _CDB_SQL(sql,'_CDB_Has_Usable_Geom');
sql := Format('ALTER TABLE %s RENAME COLUMN %s TO %s', reloid::text, has_mercgeom_name, const.mercgeomcol);
PERFORM _CDB_SQL(sql,'_CDB_Has_Usable_Geom');
END IF;