#1320 ✓resolved
jonuts

Using default values with Enum

Reported by jonuts | June 14th, 2010 @ 10:32 AM

I am running into what looks like a bug in dm-migrations using Enum type with :default option. I tested on mysql and sqlite. Sqlite does not seem to be affected for some reason.

Here is what I am doing: http://gist.github.com/437741

Followed by this error: Invalid default value for 'hello' (DataObjects::SQLError)' (full stacktrace: http://gist.github.com/437747)

I patched lib/dm-migrations/adapters/dm-do-adapter.rb (attached), and it looks like everything is working. I think the real patch would be to use if property.respond_to?(:dump) instead of using it in an elsif, as Property.type looks unused, but this works and was less scary..

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments

Referenced by

Pages