 (ns com.lemondronor.orbital-detector.createdb
   ""
-  (:require [clojure.java.jdbc :as jdbc]
+  (:require [clj-time.coerce :as timecoerce]
+            [clojure.java.jdbc :as jdbc]
             [com.lemondronor.orbital-detector.planeplotter :as orbdet]))
 
 (set! *warn-on-reflection* true)

(defn create-tables [db]
  (jdbc/db-do-commands
   db
   "CREATE TABLE IF NOT EXISTS reports (timestamp integer, icao text, registration text, altitude integer, lat real, lon real, speed real, heading real)"))

   ;; (println (jdbc/create-table-ddl
   ;;  :reports

      (jdbc/insert!
       t-con
       :reports
       {:timestamp (long (/ (timecoerce/to-long (:timestamp r)) 1000))
        :icao (:icao r)
        :registration (:registration r)
        :altitude (:altitude r)
