Champs, I am in a great need of you people. My migrations are not running on production database. I done some changes in production mode and then i ran rake db:migrate RAILS_ENV=production / RAILS_ENV="production". But my database is not reflecting. Can you people tell me that what are the possible combinations of mistake i am doing .. :) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> I am in a great need of you people. My migrations are not running on > production database. I done some changes in production mode and then i > ran rake db:migrate RAILS_ENV=production / RAILS_ENV="production". But > my database is not reflecting. Can you people tell me that what are the > possible combinations of mistake i am doing .. :)Have you changed database configuration in your database.yml? Are you getting any error messages (command line or in the log)? Did you create new migrations or edit existing ones? Does the list of applied migrations (select * FROM schema_migrations;) match the list of migrations you expect to have been run (excluding the new ones you''re thinking should run)? Does "script/console production" work and give you access to your production system? Are you using a SQLite production database (I don''t know how big your site is) that is then being removed and symlinked from a shared DB by Capistrano after migration? Running out of ideas until I get some answers... Cheers, Andy -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Andy Jeffries wrote:> > Have you changed database configuration in your database.yml?No. I have''nt changed.> > Are you getting any error messages (command line or in the log)?No i am not getting any error message at command line/log file.> > Did you create new migrations or edit existing ones?I edited migrations on my local machine and checked in them.. :) Just now i realised that this could be the problem of me. Ok tell me one thing, if i edit a already migration file, and run rake db:migrate then would that column be get affected.. ?> > Does the list of applied migrations (select * FROM schema_migrations;) > match the list of migrations you expect to have been run (excluding > the new ones you''re thinking should run)?Did not checked this.> > Does "script/console production" work and give you access to your > production system?Yeah.> > Are you using a SQLite production database (I don''t know how big your > site is) that is then being removed and symlinked from a shared DB by > Capistrano after migration?I am using MySql.> > Running out of ideas until I get some answers... > > Cheers, > > > Andy-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 27, 11:16 am, Hemant Bhargava <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > I edited migrations on my local machine and checked in them.. :) Just > now i realised that this could be the problem of me. > > Ok tell me one thing, if i edit a already migration file, and run rake > db:migrate then would that column be get affected.. ?No. rails stores which migrations have been run - if you edit it after it''s been run rails won''t run it again. Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>> Did you create new migrations or edit existing ones? > > I edited migrations on my local machine and checked in them.. :) Just > now i realised that this could be the problem of me.It is indeed :-)> Ok tell me one thing, if i edit a already migration file, and run rake > db:migrate then would that column be get affected.. ?Nope. The schema_migrations table in your database holds a list of ids that have already been applied, so editing existing migrations that have already been applied will not apply them again. You need to create a new migration and put all your changes in there. Cheers, Andy -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Andy Jeffries wrote:>>> Did you create new migrations or edit existing ones? >> >> I edited migrations on my local machine and checked in them.. :) Just >> now i realised that this could be the problem of me. > > It is indeed :-)Resolved it. Thanks to all of you with a big smile .. :) :)> >> Ok tell me one thing, if i edit a already migration file, and run rake >> db:migrate then would that column be get affected.. ? > > Nope. The schema_migrations table in your database holds a list of > ids that have already been applied, so editing existing migrations > that have already been applied will not apply them again. > > You need to create a new migration and put all your changes in there. > > Cheers, > > > Andy-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
>>> I edited migrations on my local machine and checked in them.. :) Just >>> now i realised that this could be the problem of me. >> >> It is indeed :-) > > Resolved it. Thanks to all of you with a big smile .. :) :)Happy to help. Good luck, Cheers, Andy -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I know this has already been resloved, but instead of creating a new migration, you could have gone back to version 0 rake db:migrate VERSION=0 then run rake db:migrate this should update all migrations you edited. On May 27, 6:55 am, Andy Jeffries <a...-4Fjv1yF9AWJvmwGHilWZ5bVCufUGDwFn@public.gmane.org> wrote:> >>> I edited migrations on my local machine and checked in them.. :) Just > >>> now i realised that this could be the problem of me. > > >> It is indeed :-) > > > Resolved it. Thanks to all of you with a big smile .. :) :) > > Happy to help. > > Good luck, > > Cheers, > > Andy-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 27 May 2010 15:15, anon_comp <neocoolstar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I know this has already been resloved, but instead of creating a new > migration, you could have gone back to version 0 > > rake db:migrate VERSION=0 > > then run rake db:migrate > > this should update all migrations you edited.The downside is that migrations will often have a create_table in the up method and a drop_table in the down method. As Hemant said this was on a production system, doing as you suggest would lose all his live/production data. Probably not the solution he''d desire :-) Cheers, Andy -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> The downside is that migrations will often have a create_table in the > up method and a drop_table in the down method. As Hemant said this > was on a production system, doing as you suggest would lose all his > live/production data. > > Probably not the solution he''d desire :-)Point taken :) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.