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

(ns com.lemondronor.orbital-detector.createdb
  ""
  (:require [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, type text, altitude integer, lat real, lon real, speed real, heading real)"))

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