From 3c845c39f74ab1130ba3a83d2e29c75e206bbb5b Mon Sep 17 00:00:00 2001 From: Oliver Martell Date: Thu, 15 Feb 2018 18:42:40 +0000 Subject: [PATCH] [Fix #291] Fix command to run migrations Fixes #291 Status: Finished Summary This fixes the code in main to run migrations. The issue was that the original code was using `:jdbc-database-url` vs `:database-url`. It now works for both migrations and rollbacks. I've also simplified the components started by mount as we only need to start env and not the db. --- src/clj/commiteth/core.clj | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/clj/commiteth/core.clj b/src/clj/commiteth/core.clj index d3c46a7..da45953 100644 --- a/src/clj/commiteth/core.clj +++ b/src/clj/commiteth/core.clj @@ -54,10 +54,9 @@ repl-server (cond (some #{"migrate" "rollback"} args) (do - (mount/start - #'commiteth.config/env - #'commiteth.db.core/*db*) - (migrations/migrate args (select-keys env [:jdbc-database-url])) + (mount/start #'commiteth.config/env) + (migrations/migrate args {:database-url (:jdbc-database-url env)}) + (log/info "Successfully ran" (first args)) (System/exit 0)) :else (start-app args)))