Reputation: 12320
I have different migrations file
20120205111326_change_users_login_limit.rb
20120223110929_change_attachments_container_defaults.rb
20120223110300_change_locals_container_defaults.rb
20120223110301_change_position_tracs.rb
I want to run up migration of 20120205111326
, 20120223110929
, 20120223110300
just before the last migration but condition is that it should not point its migration VERSION numbers...
Is there any ways to do it...please suggest me..
Thank you in advance
Upvotes: 0
Views: 182
Reputation: 3895
There is one way, Run your migration via rails console
require "db/migrate/20120205111326_change_users_login_limit.rb"
ChangeUsersLoginLimit.change # or 'up' or 'down' whatever method of that migration you want to run.
And do the same for all migration (don't forget to do it in sequence)
EDIT:
Rails actually don't provide a way to run migration skipping some. or run them by changing order. But the migration files are actually a ruby programs containing a single class. So you can always create a rake task and require migration in to rake task and run them in the custom logical order. After all migrations are the classes with methods.
Upvotes: 1