
Column type is uninitialized constant
Reported by Justin Bozonier | February 9th, 2011 @ 10:39 PM | in 1.1
Receiving the following error during a manual migration with datamapper in MySQL:
== Performing Up Migration #2: change_name_constraints rake aborted!
uninitialized constant SQL::TableModifier::Text
Repro (rake file):
https://gist.github.com/819956
Issue found using dm-core 1.0.2, MySQL 5.5 in conjunction with latest dm-migrations.
Comments and changes to this ticket
-
Piotr Solnica (solnic) February 10th, 2011 @ 05:08 AM
- State changed from new to unconfirmed
We've seen similar problems and I thought it had been fixed :( I suppose it works fine if you replace Text with DataMapper::Property::Text (which would be the quickest workaround for now)?
-
Jordan Ritter February 10th, 2011 @ 10:26 AM
- Tag set to dm-migrations property lookup
General property lookup works via a const_missing hook. It's isolated inside a single module in dm-core.git/lib/dm-core/property/lookup.rb, and (in dm-core) currently only applied in the context of a Model. dm-core.git/lib/dm-core/property.rb:
Model.append_extensions self, DataMapper::Property:Lookup
I'll bet the intent of narrowing the const_missing scope was to help us "play more nicely" within other systems.
As far as making this work, I'd suggest trying the following in dm-migrations.git/lib/dm-migrations/sql/table_modifier.rb:
extend DataMapper::Property::Lookup
Should add the const_missing hook, which in turn should return the property class.
-
Piotr Solnica (solnic) February 10th, 2011 @ 10:44 AM
Yes that was why we added Lookup module. I thought it's already used by migrations, I guess I'm wrong!
-
Piotr Solnica (solnic) March 5th, 2011 @ 12:24 PM
- State changed from unconfirmed to confirmed
- Milestone set to 1.1
- Assigned user set to Piotr Solnica (solnic)
- Milestone order changed from 196336 to 0
-
Piotr Solnica (solnic) March 5th, 2011 @ 01:33 PM
- State changed from confirmed to resolved
(from [4e24beded0da325e193d73536bbf1501658577f1]) Fixed problems with changing column types
[#1484 state:resolved] https://github.com/datamapper/dm-migrations/commit/4e24beded0da325e...
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.
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
Referenced by
-
1484 Column type is uninitialized constant [#1484 state:resolved] https://github.com/datamapper/dm-...