-
Notifications
You must be signed in to change notification settings - Fork 42
Issues with dm-migrations (and dm-rails) #20
Comments
I was talking to Davide on IRC He confirmed that doing DataMapper::Property::Text instead of just Text solves the uninitialized constant Text error. I (and I know some others who) couldn’t reproduce the issue with create/drop complaining about the backticks. I’m not sure, but aren’t they explicitly added for portability? Also, Davide couldn’t reproduce the issue anymore when trying today afternoon. I’m not entirely sure about the last problem concerning .sub(///,’’) but I’ve tried all the db related tasks on mysql and didn’t notice any problems neither on ruby-1.8.7 nor ruby-1.9.2-preview3. I’m not sure what new state is best for this ticket, Davide was saying that it’d be ok for him to close it. I’m assigning it to me and marking it "Hold" for now. Feel free to change. by Martin Gamsjaeger (snusnu) |
This also effects Property classes that are shadowed by Ruby constants, such as DataMapper::Property::URI. I tried using a const_missing hook to access constants from DataMapper::Property but URI is global. by Postmodern |
Injecting "URI = DataMapper::Property::URI" into DataMapper::Migration seems to do the trick. Of course this is in combination with a const_missing hook. by Postmodern |
I have confirmed that the http://github.com/postmodern/dm-migrations branch has fixed this issue for Text, Boolean, and other types in dm-core. When using URI from dm-types specifying it explicitly as DataMapper::Property::URI ie by Dennison Williams |
My const_missing hook has re-appeared in my fork of dm-core: http://github.com/postmodern/dm-core/commits/postmodern by Postmodern |
Is there a further action on this? |
As reported directly to Dan directly some users point us to an issue with dm-migrations:
In previous version of DM 1.0. for get migrations working with @text@ , @boolean@ etc... types we need to use some like this:
But now seem this hack have some problems almost with @mysql@ adapter:
So we reverted migrations to:
But we get:
So now I can't find a way for run correctly migrations.
Then I tried to inspect if we have same problem on dm-rails but on my env Im unable to create/drop databases. I think is a problem of ` here: http://github.com/datamapper/dm-rails/blob/master/lib/dm-rails/storage.rb#L120
I tried to replace this:
"CREATE DATABASE `#{database}` DEFAULT CHARACTER SET #{charset} DEFAULT COLLATE #{collation}"
into this:
"CREATE DATABASE #{database} DEFAULT CHARACTER SET #{charset} DEFAULT COLLATE #{collation}"
And worked.
I also need to change this:
Into this:
Consider that now I dropped my rvm rails machine so Im not be able to reproduce all of them.
I made some fixes for our padrino-tasks here: http://github.com/padrino/padrino-framework/blob/master/padrino-gen/lib/padrino-gen/padrino-tasks/datamapper.rb
Created by DAddYE - 2010-06-16 10:07:50 UTC
Original Lighthouse ticket: http://datamapper.lighthouseapp.com/projects/20609/tickets/1323
The text was updated successfully, but these errors were encountered: