Skip to content
Snippets Groups Projects
Commit 8b3f8fa0 authored by Cam Saul's avatar Cam Saul
Browse files

Fix tests broken by merge

parent 64fadadf
No related branches found
No related tags found
No related merge requests found
......@@ -43,8 +43,8 @@
[h2-filename & opts]
(classloader/require 'metabase.cmd.dump-to-h2)
(binding [mdb/*disable-data-migrations* true]
(let [keep-existing (boolean (some #{"--keep-existing"} opts))
return-code ((resolve 'metabase.cmd.dump-to-h2/dump-to-h2!) h2-filename keep-existing)]
(let [options {:keep-existing? (boolean (some #{"--keep-existing"} opts))}
return-code ((resolve 'metabase.cmd.dump-to-h2/dump-to-h2!) h2-filename options)]
(when (pos-int? return-code)
(System/exit return-code)))))
......
......@@ -96,14 +96,15 @@
Defaults to using `@metabase.db/db-file` as the connection string.
Target H2 DB will be deleted if it exists, unless `keep-existing` is truthy."
[h2-filename keep-existing]
Target H2 DB will be deleted if it exists, unless `keep-existing?` is truthy."
[h2-filename & [{:keys [keep-existing?]
:or {keep-existing? false}}]]
(let [h2-filename (or h2-filename "metabase_dump.h2")]
(println "Dumping to " h2-filename)
(doseq [filename [h2-filename
(str h2-filename ".mv.db")]]
(str h2-filename ".mv.db")]]
(when (and (.exists (io/file filename))
(not keep-existing))
(not keep-existing?))
(io/delete-file filename)
(println (u/format-color 'red (trs "Output H2 database already exists: %s, removing.") filename))))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment