juxt / joplin

Flexible datastore migration and seeding for Clojure projects
Eclipse Public License 1.0
316 stars 48 forks source link

Rollback fails when parsing string id #84

Open garethmdavies opened 8 years ago

garethmdavies commented 8 years ago

When performing a rollback with a migration id (and not a number of migrations to revert) the parsing of the id throws a "java.lang.NumberFormatException".

It looks like ragtime should handle this rollback scenario by performing an integer check. If the amount-or-id is an integer then the rollbacks perfoms x rollback iterations else the specific migration id is rolled back.

see joplin.alias rollback func:

(defn rollback [config-file env & [db num]]
  (let [conf (*load-config* config-file)]
    (when (and db num)
      (repl/rollback conf
                     (keyword env) (keyword db)
                     (Long/parseLong num)))) ;;<<---- is this needed??
  (System/exit 0))