Я пытаюсь использовать joplin для запуска миграций для моей базы данных Cassandra.Однако, когда я запускаю lein migrate dev
, я получаю следующее исключение:
Migrating #joplin.cassandra.database.CassandraDatabase{:hosts [127.0.0.1:9042], :keyspace test}
Exception in thread "main" java.lang.IllegalArgumentException: No matching ctor found for class com.datastax.driver.core.policies.DCAwareRoundRobinPolicy, compiling:(clojurewerkz/cassaforte/policies.clj:38:3)
Я думаю, что проблема может заключаться в моей миграции, но я не уверен, что я сделал неправильно.
project.clj
(defproject app "0.1.0"
:dependencies [[org.clojure/clojure "1.8.0"]
[clojurewerkz/cassaforte "3.0.0-alpha1"]
[joplin.core "0.3.10"]
[joplin.cassandra "0.3.10"]
[cc.qbits/alia "4.2.3"]
[cc.qbits/hayt "4.0.2"]
]
:main app.cli.core
:source-paths ["src"]
:resource-paths ["resources"]
:test-paths ["test"]
:profiles {:uberjar {:aot :all}}
:aliases {"migrate" ["run" "-m" "joplin.alias/migrate" "config.edn"]
"seed" ["run" "-m" "joplin.alias/seed" "config.edn"]
"rollback" ["run" "-m" "joplin.alias/rollback" "config.edn"]
"reset" ["run" "-m" "joplin.alias/reset" "config.edn"]
"pending" ["run" "-m" "joplin.alias/pending" "config.edn"]
"create" ["run" "-m" "joplin.alias/create" "config.edn"]}
)
config.edn
{:migrators {:cass-mig "resources/migrators"}
:seeds {:cass-seed "seeds.cass/run"}
:databases {:cass-dev {:type :cass, :hosts ["127.0.0.1:9042"],
:keyspace "test"}}
:environments {:dev [{:db :cass-dev, :migrator :cass-mig, :seed :cass-seed}]}}
migrators
(ns migrators.20180717174605-test
(:use [joplin.cassandra.database])
(:require [clojurewerkz.cassaforte.client :as client]
[clojurewerkz.cassaforte.cql :refer :all]))
(defn up [db]
(let [conn (client/connect (:hosts db))]
(create-keyspace conn "test")))
(defn down [db]
(let [conn (client/connect (:hosts db))]
(drop-keyspace conn "test")))