Closed leblowl closed 6 years ago
I'm thinking it might be good to return the migrations as a collection, and log/debug. This way the output is also useful programmatically:
(defn pending-list
"List pending migrations"
[config]
(let [migrations-name (->> (doto (proto/make-store config)
(proto/connect))
(uncompleted-migrations config)
(map proto/name))
migrations-count (count migrations-name)]
(log/debug "You have " migrations-count " pending migrations:\n"
(clojure.string/join "\n" migrations-name))
migrations-name))
Awesome, I think that's a great idea.
Ok great, I pushed out version 1.0.4 to Clojars with the update.
thanks!
Instead of returning the info string in the
pending-list
command @ https://github.com/yogthos/migratus/blob/master/src/migratus/core.clj#L148, would you rather uselog/debug
as is used elsewhere in the library for other commands? Usingpending-list
command outside of the REPL (e.g. https://github.com/luminus-framework/luminus-template/blob/2e0312c0d7b1726ca52bbc80aadbfd6a44fe9b99/resources/leiningen/new/luminus/core/src/core.clj#L73-L75) will result in not seeing the output unless you print/log the return value.