Jorge alejandro Mendoza torres
2010-May-18 16:35 UTC
When I do a migration, the changes are make in the test db
When I do a migration, the changes are make in the test database. Does anyone know the reason? In the config/environment.rb file, I have this: ENV[''RAILS_ENV''] ||''production'' And in the db/ folder, it creates a file named test.sqlite3 When I did the migrations, RoR used the test database, but when I want to make something in the application, the migrations don´t appear because the app is using the production database. Please, help me. -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-May-18 17:09 UTC
Re: When I do a migration, the changes are make in the test db
On May 18, 5:35 pm, Jorge alejandro Mendoza torres <li...@ruby- forum.com> wrote:> When I do a migration, the changes are make in the test database. Does > anyone know the reason? > > In the config/environment.rb file, I have this: ENV[''RAILS_ENV''] ||> ''production'' > > And in the db/ folder, it creates a file named test.sqlite3 > > When I did the migrations, RoR used the test database, but when I want > to make something in the application, the migrations don´t appear > because the app is using the production database. >Is the environment variable RAILS_ENV set ? Fred> Please, help me. > -- > 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-/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 athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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.
daphonz
2010-May-18 20:49 UTC
Re: When I do a migration, the changes are make in the test db
Have you tried using: rake db:migrate RAILS_ENV=production -c On May 18, 12:35 pm, Jorge alejandro Mendoza torres <li...@ruby- forum.com> wrote:> When I do a migration, the changes are make in the test database. Does > anyone know the reason? > > In the config/environment.rb file, I have this: ENV[''RAILS_ENV''] ||> ''production'' > > And in the db/ folder, it creates a file named test.sqlite3 > > When I did the migrations, RoR used the test database, but when I want > to make something in the application, the migrations don´t appear > because the app is using the production database. > > Please, help me. > -- > 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-/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 athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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.
Jorge alejandro Mendoza torres
2010-May-19 15:09 UTC
Re: When I do a migration, the changes are make in the test db
daphonz wrote:> Have you tried using: > > rake db:migrate RAILS_ENV=production > > -c > > On May 18, 12:35�pm, Jorge alejandro Mendoza torres <li...@ruby-I already tried the instruction and the migrations were made in the production database. But I have another problem, I had a record and I inserted others three records to my table, if I make a search and I want to find one of three new records, I can''t find it, for instance: var = Table.find(:first, :conditions => ["id_oficina = ?", clave[i].to_i]) In my table, all records exist. -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-May-19 16:34 UTC
Re: Re: When I do a migration, the changes are make in the test db
On 19 May 2010 16:09, Jorge alejandro Mendoza torres <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> daphonz wrote: >> Have you tried using: >> >> rake db:migrate RAILS_ENV=production >> >> -c >> >> On May 18, 12:35�pm, Jorge alejandro Mendoza torres <li...@ruby- > > I already tried the instruction and the migrations were made in the > production database. > > But I have another problem, I had a record and I inserted others three > records to my table, if I make a search and I want to find one of three > new records, I can''t find it, for instance: > > var = Table.find(:first, :conditions => ["id_oficina = ?", > clave[i].to_i]) > > In my table, all records exist.You would really have been be better to start a new thread for this. Now the subject does not relate to your problem. Have a look in the log file (development.log if you are in development mode), it will show the sql being used. Does it look right? How do you know it is not finding the record? Colin -- 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.