
rake db:migrate not working?
Reported by mark | September 18th, 2010 @ 02:59 AM | in 1.1
I'm not sure whether it's my or dm-rails's issue but I couldn't get the raketask to work.
Source of the problem is that migration module is included into Object namespace in order to make shortcuts (like migrate {}) possible:
include DataMapper::MigrationRunner
The raketask, on other hand, uses full module path as in:
::DataMapper::MigrationRunner.migrate_up!
::DataMapper::MigrationRunner and ::Object have different instance variables so method
def migrations
@migrations ||= []
end
will return different values for migrator raketask and for migrate ruby scripts in db/mgirate/*.
There are different ways to solve that, the most backward compatible is probably running migrate_up! directly from Object. On other hand, using the root-level namespace is a kind of mauvais ton.
Comments and changes to this ticket
-
Martin Gamsjaeger (snusnu) October 24th, 2010 @ 02:21 PM
- State changed from new to resolved
- Milestone set to 1.1
- Assigned user set to Martin Gamsjaeger (snusnu)
- Milestone order changed from 196282 to 0
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 »