Sadly, there is no improvement.  I've made a minimal project to
demonstrate.  Literally

- lein new tdrift
- modify project.clj
- add migration-config.clj
- add appropriate migration directory
- lein deps
- lein create-migration

I've put it up on github (https://github.com/ejackson/tdrift).
Perhaps if we can git it to work we can get to the bottom of this ?

Thank for the help here,

 Edmund



On 27/11/2011 00:39, Matt wrote:
> It looks like a bug in Drift. Try adding an init function which
> takes one argument but doesn't do anything.
> 
> Your new migrate-config should look something like:
> 
> (defn migrate-config [] {:init (fn [_] ) :directory
> "/db/migrations" :current-version db-version :update-version
> update-db-version})
> 
> Let me know if that does the trick and I'll fix the bug in Drift.
> 
> 
> On Nov 26, 8:31 am, Edmund <edmundsjack...@gmail.com> wrote:
>> Hello,
>> 
>> Thanks for this library, it'll really help me out.  I'm a little 
>> stuck on getting bootstrapped, can you perhaps give me some
>> guidance ? Basically I'm stuck at step 5, attempting to create my
>> first migration, what am I missing ?
>> 
>> Thanks,
>> 
>> Edmund
>> 
>> -----------------------------------------------------------------
>>
>> 
Steps taken
>> 1.  Added to :dev-dependencies in project.clj [drift "1.4.0"] 
>> [org.drift-db/drift-db-mysql "1.0.4"]
>> 
>> 2. Created a table to hold the version number inserted 0 create
>> table schema_migrations ( version int not null primary key )
>> engine InnoDB;
>> 
>> 3. Created src/config/migrate_config.clj (ns
>> config.migrate-config (:require [clojure.contrib.sql :as sql]))
>> 
>> (defonce DB (atom {:classname "com.mysql.jdbc.Driver" 
>> :subprotocol "mysql" :subname "//mysql-server:3306/bookkeeper" 
>> :user "user" :password "password" :auto-commit true :fetch-size
>> 500}))
>> 
>> (defn db-version [] (sql/with-connection DB 
>> (sql/with-query-results res ["select version from
>> schema_migrations limit 1"] (:version (first res)))))
>> 
>> (defn update-db-version [version] (sql/with-connection DB 
>> (sql/insert-values :schema_migrations [:version] [version])))
>> 
>> (defn migrate-config [] {:directory "/db/migrations" 
>> :current-version db-version :update-version update-db-version})
>> 
>> 4. Run lein deps to grab the deps
>> 
>> 5. Attempted to create a migration, or get something going
>> 
>> $ lein create-migration first Listening for transport dt_socket
>> at address: 57528 Exception in thread "main"
>> java.lang.RuntimeException: java.lang.NoSuchMethodError: 
>> clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V 
>> at clojure.lang.Util.runtimeException(Util.java:165) at
>> clojure.lang.Compiler.eval(Compiler.java:6476) at
>> clojure.lang.Compiler.eval(Compiler.java:6455) at
>> clojure.lang.Compiler.load(Compiler.java:6902) at
>> clojure.lang.RT.loadResourceScript(RT.java:357) at
>> clojure.lang.RT.loadResourceScript(RT.java:348) at
>> clojure.lang.RT.load(RT.java:427) at
>> clojure.lang.RT.load(RT.java:398) at
>> clojure.core$load$fn__4610.invoke(core.clj:5386) at
>> clojure.core$load.doInvoke(core.clj:5385) at
>> clojure.lang.RestFn.invoke(RestFn.java:408) at
>> clojure.core$load_one.invoke(core.clj:5200) at
>> clojure.core$load_lib.doInvoke(core.clj:5237) at
>> clojure.lang.RestFn.applyTo(RestFn.java:142) at
>> clojure.core$apply.invoke(core.clj:602) at
>> clojure.core$load_libs.doInvoke(core.clj:5271) at
>> clojure.lang.RestFn.applyTo(RestFn.java:137) at
>> clojure.core$apply.invoke(core.clj:602) at
>> clojure.core$require.doInvoke(core.clj:5352) at
>> clojure.lang.RestFn.invoke(RestFn.java:421) at
>> drift.generator$eval5$loading__4505__auto____6.invoke(generator.clj:1)
>>
>> 
at drift.generator$eval5.invoke(generator.clj:1)
>> at clojure.lang.Compiler.eval(Compiler.java:6465) at
>> clojure.lang.Compiler.eval(Compiler.java:6455) at
>> clojure.lang.Compiler.load(Compiler.java:6902) at
>> clojure.lang.RT.loadResourceScript(RT.java:357) at
>> clojure.lang.RT.loadResourceScript(RT.java:348) at
>> clojure.lang.RT.load(RT.java:427) at
>> clojure.lang.RT.load(RT.java:398) at
>> clojure.core$load$fn__4610.invoke(core.clj:5386) at
>> clojure.core$load.doInvoke(core.clj:5385) at
>> clojure.lang.RestFn.invoke(RestFn.java:408) at
>> clojure.core$load_one.invoke(core.clj:5200) at
>> clojure.core$load_lib.doInvoke(core.clj:5237) at
>> clojure.lang.RestFn.applyTo(RestFn.java:142) at
>> clojure.core$apply.invoke(core.clj:602) at
>> clojure.core$load_libs.doInvoke(core.clj:5271) at
>> clojure.lang.RestFn.applyTo(RestFn.java:137) at
>> clojure.core$apply.invoke(core.clj:602) at
>> clojure.core$require.doInvoke(core.clj:5352) at
>> clojure.lang.RestFn.invoke(RestFn.java:408) at
>> user$eval1.invoke(NO_SOURCE_FILE:1) at
>> clojure.lang.Compiler.eval(Compiler.java:6465) at
>> clojure.lang.Compiler.eval(Compiler.java:6454) at
>> clojure.lang.Compiler.eval(Compiler.java:6431) at
>> clojure.core$eval.invoke(core.clj:2795) at
>> clojure.main$eval_opt.invoke(main.clj:296) at
>> clojure.main$initialize.invoke(main.clj:315) at
>> clojure.main$null_opt.invoke(main.clj:348) at
>> clojure.main$main.doInvoke(main.clj:426) at
>> clojure.lang.RestFn.invoke(RestFn.java:421) at
>> clojure.lang.Var.invoke(Var.java:405) at
>> clojure.lang.AFn.applyToHelper(AFn.java:163) at
>> clojure.lang.Var.applyTo(Var.java:518) at
>> clojure.main.main(main.java:37) Caused by:
>> java.lang.NoSuchMethodError: 
>> clojure.lang.KeywordLookupSite.<init>(ILclojure/lang/Keyword;)V 
>> at drift.core$find_init_fn.<clinit>(core.clj:25) at
>> drift.core__init.load(Unknown Source) at
>> drift.core__init.<clinit>(Unknown Source) at
>> java.lang.Class.forName0(Native Method) at
>> java.lang.Class.forName(Class.java:247) at
>> clojure.lang.RT.loadClassForName(RT.java:2030) at
>> clojure.lang.RT.load(RT.java:417) at
>> clojure.lang.RT.load(RT.java:398) at
>> clojure.core$load$fn__4610.invoke(core.clj:5386) at
>> clojure.core$load.doInvoke(core.clj:5385) at
>> clojure.lang.RestFn.invoke(RestFn.java:408) at
>> clojure.core$load_one.invoke(core.clj:5200) at
>> clojure.core$load_lib.doInvoke(core.clj:5237) at
>> clojure.lang.RestFn.applyTo(RestFn.java:142) at
>> clojure.core$apply.invoke(core.clj:602) at
>> clojure.core$load_libs.doInvoke(core.clj:5271) at
>> clojure.lang.RestFn.applyTo(RestFn.java:137) at
>> clojure.core$apply.invoke(core.clj:602) at
>> clojure.core$require.doInvoke(core.clj:5352) at
>> clojure.lang.RestFn.invoke(RestFn.java:457) at
>> drift.builder$eval11$loading__4505__auto____12.invoke(builder.clj:1)
>>
>> 
at drift.builder$eval11.invoke(builder.clj:1)
>> at clojure.lang.Compiler.eval(Compiler.java:6465) ... 53 more
>> 
>> On 24/11/2011 22:38, Matt wrote:
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>>> Drift is a Rails like migration library for Clojure.
>> 
>>> I've recently released version 1.4.0 of Drift which includes:
>> 
>>> A new Java interface. You can now run Drift migrations, find
>>> out the database version, or determine the highest migration
>>> number from java.
>> 
>>> User generated migration numbers and time stamp migration
>>> numbers. You can now create your own migration number generator
>>> or use one of the ones included with Drift. By default, Drift
>>> will now create the migration number from the current time. You
>>> can still use the old incremental migration number generator if
>>> you want.
>> 
>>> You can find the code for Drift on Github: 
>>> http://github.com/macourtney/drift
>> 
>>> Drift on Clojars:http://clojars.org/drift
> 

-- 
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

Reply via email to