   (drop-table conn {:table-name (:table-name dataset-version)})
   (update-successful-job-execution conn {:id job-execution-id}))
 
-(defn failed-update [conn job-execution-id reason]
+(defn- failed-update [conn job-execution-id reason]
   (update-failed-job-execution conn {:id job-execution-id
                                      :reason [reason]}))
 

                                                      :data-source-id data-source-id})
    (future
      (try
        (jdbc/with-db-transaction [tx-conn tenant-conn]
          (do-update tx-conn
                     config
                     dataset-id
                     data-source-id
                     job-execution-id
                     data-source-spec))
        (catch Exception e
          (failed-update tenant-conn job-execution-id (.getMessage e))
          (p/track error-tracker e)

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

(defn- successful-update
  "On a successful update we need to create a new dataset-version that
  is similar to the previous one, except with an updated :version and
  pointing to the new table-name, imported-table-name and columns. We
