Make sure you require the sql migrations in your jub.datasources source
file. This is probably it since jub.datasources cannot find the correct
defmethod for migrate-db. Also make sure the migrations are on the
classpath.

On Sat, 21 Mar 2015 at 09:38 Hildeberto Mendonça <m...@hildeberto.com> wrote:

> Hello,
>
> I'm trying to use Joplin for database migration in the project
> javaee-utility-belt (despite the name, it's written in Clojure ;-) The way
> I found to start programming in Clojure at work:
> https://github.com/htmfilho/javaee-utility-belt), but I'm getting the
> following exception:
>
> #<CompilerException java.lang.IllegalArgumentException: No method in
> multimethod 'migrate-db' for dispatch value: :sql,
> compiling:(jub/core.clj:5:16)>
>
> I've added joplin.core in my dependencies:
>
>   :dependencies [[org.clojure/clojure "1.6.0" ]
>                  [org.clojure/java.jdbc "0.3.6" ]
>                  [mysql/mysql-connector-java "5.1.25"]
>                  [joplin.core "0.2.9" ]]
>
> I'm trying to call Joplin from code to run the migration automatically at
> every execution. For that, I wrote datasource.clj as follows:
>
> (ns jub.datasource
>   (:require [clojure.java.jdbc :as jdbc]
>             [joplin.core       :as joplin]))
>
> (def mysql-db {:subprotocol "mysql"
>                :subname     "//localhost:3306/jub"
>                :user        "jub_user"
>                :password    "psswd"})
>
> (def joplin-target {:db {:type :sql, :url (str "jdbc:mysql:" (get mysql-db
> :subname)
>                                                "?user="      (get mysql-db
> :user)
>                                                "&password="  (get mysql-db
> :password))}
>                     :migrator "resources/migrators/sql"})
>
> (defn migrate-mysql-db []
>   (joplin/migrate-db joplin-target))
>
> Then, I'm calling migrate-mysql-db from core.clj, as follows:
>
> (ns jub.core
>   (:require [jub.log-file      :refer :all]
>                [jub.datasource    :refer (migrate-mysql-db)])
>   (:gen-class))
>
> (migrate-mysql-db)
>
> When I start the repl (lein repl) the function (migrate-mysql-db) is
> called and the exception above is produced.
>
> You can see the code in this branch:
> https://github.com/htmfilho/javaee-utility-belt/tree/Issue%237
>
> Can anybody help me with this issue? Thanks in advance!
>
> --
> Hildeberto Mendonça <https://twitter.com/htmfilho>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to