     :up   (log/debug "Applying" id)
     :down (log/debug "Rolling back" id)))
 
-(defn cleanup-db-fixture [path]
-  (log/info "deleting database fixture:" path)
-  (io/delete-file (str path ".mv.db"))
-  nil)
+(defn cleanup-db-fixture [file]
+  (log/info "deleting temporaray test database: " (.getAbsolutePath file))
+  (io/delete-file file))
 
 (defrecord DatabaseFixture [config created]
   component/Lifecycle

    (if (not created) ; already stopped
      this
      (do
        (cleanup-db-fixture (:path config))
        (assoc this :created false)))))

(defn new-db-fixture []

; ------------------------------------------------------------------------------

(defn gen-db-fixture-config []
  (let [file     (java.io.File/createTempFile "test-db-" ".mv.db")
        absolute (.getAbsolutePath file)
        path     (subs absolute 0 (- (count absolute) 6))]
    (.deleteOnExit file)
    {:file file
     :path path
     :rw (str "jdbc:h2:file:" path ";MODE=MySQL;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=1")
     :ro (str "jdbc:h2:file:" path ";MODE=MySQL;TRACE_LEVEL_FILE=0;TRACE_LEVEL_SYSTEM_OUT=1;ACCESS_MODE_DATA=r")}))

