when I do the rake db:migrate, with a migration file that is supposed to add 3 records to the database, it ends up doing nothing to the database at all. here is what happens when I type in: "rake db:migrate --trace" (in C:/InstantRails/rails_apps/work/depot) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate ** Invoke db:schema:dump (first_time) ** Invoke environment ** Execute db:schema:dump And then it''s back to the command prompt. Any suggestions as to why it is doing nothing? -- 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 -~----------~----~----~----~------~----~------~--~---
Alright, I made a new migration file, with the same code, and it works now. So my new question is this: If I make a migration file, and then do a rake db:migrate, and then I want to change one of the migration files, how can I do that? It seems that once I''ve done the rake db:migrate, it does not recognize any changes to the migration files that are there. -- 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 -~----------~----~----~----~------~----~------~--~---
In that case, your database was already at the highest schema. When you added a new migration, db:migrate saw a migration with a higher version number and processed it (Migrate creates a schema_info table in your DB). Read up on migrations here: http://api.rubyonrails.org/classes/ActiveRecord/Migration.html Jason On 2/16/07, Josh P. <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Alright, I made a new migration file, with the same code, and it works > now. So my new question is this: > > If I make a migration file, and then do a rake db:migrate, and then I > want to change one of the migration files, how can I do that? > > It seems that once I''ve done the rake db:migrate, it does not recognize > any changes to the migration files that are there. > > -- > 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 -~----------~----~----~----~------~----~------~--~---
yeah you can either 1) change migrations, then migrate ''down'' then up 2) add a new migration that changes the schema (better -- you can rename tables, etc.) On Feb 16, 12:56 pm, "Josh P." <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Alright, I made a new migration file, with the same code, and it works > now. So my new question is this: > > If I make a migration file, and then do a rake db:migrate, and then I > want to change one of the migration files, how can I do that? > > It seems that once I''ve done the rake db:migrate, it does not recognize > any changes to the migration files that are there. > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---