Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modified dump command to handle keyword and string name argument.

  • Loading branch information...
commit 42cebf45dbedcfe44fe4ec143d10f1b37f094f8a 1 parent 2dbf73c
@budu budu authored
Showing with 11 additions and 8 deletions.
  1. +11 −8 src/lobos/core.clj
View
19 src/lobos/core.clj
@@ -211,11 +211,14 @@
(mig/do-migrations* db-spec sname :down names)))
(defcommand dump [name & [msg]]
- (when-not name
- (throw (IllegalArgumentException.
- "Migration must be named.")))
- (when ((set (mig/list-migrations-names)) (str name))
- (throw (IllegalArgumentException.
- "Migration name is already taken.")))
- (mig/dump* db-spec sname name msg (mig/read-stash-file))
- (mig/clear-stash-file))
+ (let [name (symbol (if (string? name)
+ name
+ (clojure.core/name name)))]
+ (when-not name
+ (throw (IllegalArgumentException.
+ "Migration must be named.")))
+ (when ((set (mig/list-migrations-names)) (str name))
+ (throw (IllegalArgumentException.
+ "Migration name is already taken.")))
+ (mig/dump* db-spec sname name msg (mig/read-stash-file))
+ (mig/clear-stash-file)))
Please sign in to comment.
Something went wrong with that request. Please try again.