hi all, in my db/migrate folder im having many migrations files that creates tables,add columns,and remove columns.i created a new migration file now and can i run only this new migration file using rake command.how to run a specific migration using rake command.people know it help me please. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 29, 2008, at 3:28 AM, Karthikragunath Bhavani wrote:> hi all, > > in my db/migrate folder im having many migrations files that > creates tables,add columns,and remove columns.i created a new > migration > file now and can i run only this new migration file using rake > command.how to run a specific migration using rake command.people know > it help me please.You can do: rake db:migrate VERSION=12 to run the migrations necessary to get to version 12 from wherever you are. If the database is at version 11, that will cause the 012_* up migration to run, if at 13, the 012_* down migration will run. There is no command to pluck a particular migration out of the middle and run it (up or down). Normally, you just add the migration and run: rake db:migrate and it does the right thing. I tend to make a backup of the development database and then run migrations forward VERSION=12 and then backward VERSION=11 until I''m sure that the migration is reversible (usually when there''s some non-trivial data-munging going on). -Rob Rob Biedenharn http://agileconsultingllc.com Rob-xa9cJyRlE0mWcWVYNo9pwxS2lgjeYSpx@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
For specific updates you can manipulate the schema.rb file accordingly and load it. rake db:schema:dump dumps the schema and load does the opposite. So you can dump, include all the migration changes you want and load for a quick solution. On Tue, Apr 29, 2008 at 12:58 PM, Karthikragunath Bhavani < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > > hi all, > > in my db/migrate folder im having many migrations files that > creates tables,add columns,and remove columns.i created a new migration > file now and can i run only this new migration file using rake > command.how to run a specific migration using rake command.people know > it help me please. > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---