Skip to content

Commit

Permalink
Fixed issue with rollback that wasn't properly reversing the order of…
Browse files Browse the repository at this point in the history
… migrations.
  • Loading branch information
budu committed Aug 29, 2011
1 parent 636ba7a commit 3f1eb0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/lobos/core.clj
Expand Up @@ -201,8 +201,7 @@
[(last (mig/query-migrations-table db-spec sname))]
(= 1 (count args))
(let [arg (first args)
migs (reverse
(mig/query-migrations-table db-spec sname))]
migs (mig/query-migrations-table db-spec sname)]
(cond
(integer? arg) (take arg migs)
(= arg :all) migs
Expand Down
5 changes: 3 additions & 2 deletions src/lobos/migration.clj
Expand Up @@ -231,9 +231,10 @@
(list-migrations-names)))

(defn do-migrations [db-spec sname with names & [silent]]
(let [migrations (->> names
(let [filter-migs #(only % (list-migrations-names))
migrations (->> names
(map str)
(only (list-migrations-names))
filter-migs
(when->> (= with :down) reverse)
(map symbol)
(map (partial ns-resolve *migrations-namespace*))
Expand Down

0 comments on commit 3f1eb0c

Please sign in to comment.