dankelley
2007-Jan-14 17:35 UTC
migrate problem (have to go back, then forward, to "stick")
I wonder if I''m reading the various tutorials (and Agile book, version 2) incorrectly... I make an app, and then edit e.g. by adding a new column to migrate/002_stuff.db and then run rake migrate rake db:structure:dump && cat db/development_structure.sql but I see no change in the database. However, the database *is* updated if I do rake migrate VERSION=0 rake migrate But isn''t one supposed just to edit the migrate/*.rb files and do rake migrate ? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Matthew Margolis
2007-Jan-14 17:42 UTC
Re: migrate problem (have to go back, then forward, to "stick")
dankelley wrote:> > I wonder if I''m reading the various tutorials (and Agile book, version > 2) incorrectly... > > I make an app, and then edit e.g. by adding a new column to > migrate/002_stuff.db > and then run > rake migrate > rake db:structure:dump && cat db/development_structure.sql > but I see no change in the database. > > However, the database *is* updated if I do > rake migrate VERSION=0 > rake migrate > > But isn''t one supposed just to edit the migrate/*.rb files and do > rake migrate > ? > > > >When you just run rake migrate you are telling the system to run all the migration files that are a higher number than your current db version. If you are already at version 2 and you run rake migrate after editing 002_stuff.rb nothing new will happen. When you run rake migrate VERSION=0 then you are resetting things so 002_stuff.rb is a newer file(2) than your db state(0). Matt Margolis blog.mattmargolis.net --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---