     (add-column conn {:table-name table-name
                       :new-column-name (get column "columnName")
                       :column-type (condp = (get column "type")
-                                     "text" "text"
+                                     "date" "timestamptz"
+                                     "geopoint" "geometry(POINT, 4326)"
+                                     "geoshape" "geometry(GEOMETRY, 4326)"
                                      "number" "double precision"
-                                     "date" "timestamptz")})))
+                                     "text" "text")})))
 
 (defn insert-merged-data
   "Insert the merged values into the target dataset"

          (or aggregationColumn mergeColumn)
          aggregationDirection))

(defn to-sql-types [row merge-columns]
  ;; For now we only need to change date types.
  (let [date-columns (filter #(= "date" (get % "type")) merge-columns)]
    (reduce (fn [result-row {:strs [columnName]}]
              (update result-row columnName #(when % (Timestamp. %))))
            row
            date-columns)))

(defn fetch-data
  "Fetch data from the source dataset and returns a map with the shape

            [clojure.set :as set]
            [clojure.string :as s]
            [hugsql.core :as hugsql])
  (:import [akvo.lumen.import.common Geoshape Geopoint]
           [java.sql Timestamp]))

(hugsql/def-db-fns "akvo/lumen/transformation.sql")
(hugsql/def-db-fns "akvo/lumen/transformation/engine.sql")
