   (:require [qbits.hayt :as hayt]
             [kixi.hecuba.storage.db :as db]
             [kixi.hecuba.api.measurements :as measurements]
-            [clojure.tools.logging :as log]))
+            [clojure.tools.logging :as log]
+            [clj-time.core :as t]
+            [clj-time.format :as tf]
+            [clj-time.coerce :as tc]))
 
 (defn do-map
   "Map with side effects."

                                                         [= :month (:month %)]
                                                         [= :timestamp (:timestamp %)]]))) measurements)))))
  (log/info "Finished migrating reading metadata."))

  (db/with-session [session (:hecuba-session store)]
    (let [sensors (db/execute session (hayt/select :sensors))]
      (doseq [s sensors]
        (let [measurements (measurements/all-measurements store s)]
          (do-map #(db/execute session
                               (hayt/update :measurements
