From 731ee0a9ba390c8f7d8f67fdef8ad5d2a5c27cec Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Mon, 14 Sep 2015 17:05:59 +0200 Subject: [PATCH] Fix `the_geom_webmercator` already exists #141 --- scripts-available/CDB_CartodbfyTable.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts-available/CDB_CartodbfyTable.sql b/scripts-available/CDB_CartodbfyTable.sql index dbea59a..51fcff6 100644 --- a/scripts-available/CDB_CartodbfyTable.sql +++ b/scripts-available/CDB_CartodbfyTable.sql @@ -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;