|
283 | 283 | "Migratus API does not support this action(s) : " arguments "\n\n" |
284 | 284 | (str/join (usage summary)))) |
285 | 285 |
|
286 | | -(defn run-migrate! [cfg args] |
| 286 | +(defn run-migrate! [store args] |
287 | 287 | (let [cmd-opts (parse-opts args migrate-cli-options :in-order true) |
288 | 288 | {:keys [options arguments errors summary]} cmd-opts |
289 | | - rest-args (rest arguments)] |
290 | | - |
| 289 | + rest-args (rest arguments) |
| 290 | + cfg (proto/config store)] |
291 | 291 | (cond |
292 | 292 | errors (error-msg errors) |
293 | 293 | (:until-just-before options) |
|
299 | 299 | (migratus/migrate cfg)) |
300 | 300 | :else (no-match-message args summary)))) |
301 | 301 |
|
302 | | -(defn run-rollback! [cfg args] |
| 302 | +(defn run-rollback! [store args] |
303 | 303 | (let [cmd-opts (parse-opts args rollback-cli-options :in-order true) |
304 | 304 | {:keys [options arguments errors summary]} cmd-opts |
305 | | - rest-args (rest arguments)] |
| 305 | + rest-args (rest arguments) |
| 306 | + cfg (proto/config store)] |
306 | 307 |
|
307 | 308 | (cond |
308 | 309 | errors (error-msg errors) |
|
465 | 466 | (.removeHandler main-logger h)) |
466 | 467 | (.addHandler main-logger handler)))) |
467 | 468 |
|
468 | | -(defn run-up! [cfg args] |
| 469 | +(defn run-up! [store args] |
469 | 470 | (if (empty? args) |
470 | 471 | (println-err |
471 | 472 | "To run action up you must provide a migration-id as a parameter: |
472 | 473 | up <migration-id>") |
473 | 474 | (->> args |
474 | 475 | (map #(my-parse-long %)) |
475 | | - (apply migratus/up cfg)))) |
| 476 | + (apply migratus/up (proto/config store))))) |
476 | 477 |
|
477 | | -(defn run-down! [cfg args] |
| 478 | +(defn run-down! [store args] |
478 | 479 | (if (empty? args) |
479 | 480 | (println-err |
480 | 481 | "To run action down you must provide a migration-id as a parameter: |
481 | 482 | down <migration-id>") |
482 | 483 | (->> args |
483 | 484 | (map #(my-parse-long %)) |
484 | | - (apply migratus/down cfg)))) |
| 485 | + (apply migratus/down (proto/config store))))) |
485 | 486 |
|
486 | 487 | (defn format-status-line |
487 | 488 | "Format transaction status line" |
|
570 | 571 | (println-err (ex-data e))))) |
571 | 572 |
|
572 | 573 | (defn- run-init! |
573 | | - [cfg] |
574 | | - (migratus/init cfg)) |
| 574 | + [store] |
| 575 | + (migratus/init (proto/config store))) |
575 | 576 |
|
576 | 577 | (defn do-print-usage |
577 | 578 | ([summary] |
|
0 commit comments