Issue with rollback command.

15 views
Skip to first unread message

Manoj Waikar

unread,
Jun 8, 2011, 1:03:40 PM6/8/11
to lobos-...@googlegroups.com
Hi,

I created a schema and two tables inside it. Then when I run dump, a single migration file is created with appropriate (create and drop) statements (instead of two files created if I just create two tables without any schema). But after that, if I run rollback, I get this error - "No implementation of method: :build-drop-statement of protocol: #'lobos.schema/Dropable found for class: nil"

I am not able to figure out which record doesn't implement the Dropable protocol?

Thanks for any help.

Regards,
Manoj.

Nicolas Buduroi

unread,
Jun 8, 2011, 1:25:09 PM6/8/11
to lobos-...@googlegroups.com
That's probably a bug, could you post the content of the migration file?

Nicolas Buduroi

unread,
Jun 8, 2011, 6:31:34 PM6/8/11
to lobos-...@googlegroups.com
I've just released a new snapshot containing the new version of the migration feature. Could you check if you're still getting the same issue with it?

Manoj Waikar

unread,
Jun 17, 2011, 4:35:28 PM6/17/11
to lobos-...@googlegroups.com
Now the dump, rollback and run methods seem to run fine (except for the drop schema statement generated without the cascade clause).

However, I have a doubt - if I (dump 'x) then a defmigration with name x is created. Next time if I again (dump 'y), then this new defmigration will be appended to the same migrations file.

Isn't it better to have each migration in its own file, otherwise the migrations file (for a huge DB with lots of changes) might become unmanageable.

Nicolas Buduroi

unread,
Jun 17, 2011, 4:43:29 PM6/17/11
to lobos-...@googlegroups.com
On Fri, Jun 17, 2011 at 4:35 PM, Manoj Waikar <mmwa...@gmail.com> wrote:
Now the dump, rollback and run methods seem to run fine (except for the drop schema statement generated without the cascade clause).

I'll have a look at your patch next week, that should be a good improvement.
 
However, I have a doubt - if I (dump 'x) then a defmigration with name x is created. Next time if I again (dump 'y), then this new defmigration will be appended to the same migrations file.

Isn't it better to have each migration in its own file, otherwise the migrations file (for a huge DB with lots of changes) might become unmanageable.

That's a potential drawback, but it shouldn't happen often in practice. Also, if the migrations file become too large, you could always split it up using standard Clojure code, say using the `load` function.
Reply all
Reply to author
Forward
0 new messages