Shantanu Pavgi wrote:
> Thanks for the help.
> 
> But then what is the purpose of db:migrate:down (and self.down method in 
> migration file)? The method self.down does roll back any changes if 
> needed, but its effects are not reflected in other areas such as 'rake 
> test'.

Migrations really shouldn't be thought of as "choose 4 items from part A 
of the menu".

If you need to make adjustments to your schema, you either rollback to a 
previous version of the schema earlier than what you want to undo and 
edit those migrations (each self.down should undo its self.up), or you 
create new migrations to remove what you don't want/need anymore (the 
self.down should put back what self.up removes).

The strength of the serial migrations is that you can migrate to the 
state of the schema at any point in time.

Riddle me this Batman:

If you undo just migrations 15, 17, 22, 25, and later add a new 
migration 33, what do you expect would happen when you rake db:migrate 
again?

I suspect that your pending migrations are migration files (like 
017_add_x.rb) that aren't referenced in the schema_migrations table.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to