Could some one explain why there is three different possible databases – development, test and production? What''s the difference? How do you switch between them? -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Hi Pal, you are switching between them by using a different environment by stating the environment you want to use in environment.rb or by telling your application server to do so (for example the mongrel by mongrel_rails start -e production. The environment is what is the ''headline'' above the configurations. A database-config comes with three predefined environments ''development'', ''test'' and ''production'' but you might configure some others for yourself. The test environment is special because integration tests with fixtures which represent test data will be performed on a special test database. The advantage should be obvious. On the development database you should perform your development. This might be an physically different machine from your production database or at least decoupled as another database on the same machine. This way you could release stable versions to production and go online with it and destroy nothing on your production data while you are evolving on the development db. Said shortly: As in many cases rails forces you to do the right thing. Cheers, Jan --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tom Mornini
2006-Aug-22 09:16 UTC
[Rails] Re: Development, test and production - what for?
On Aug 22, 2006, at 1:46 AM, Pål Bergström wrote:> Could some one explain why there is three different possible databases > – development, test and production? What''s the difference? How do you > switch between them?Development is for development. Test is for testing. Production is for... :-) They are switched on via ENV[''RAILS_ENV''] Also switched on are the config/environments/* files. You can have more environments if you choose. Development and Testing are related in that when running tests, the development DB structure is moved into testing so that tests get run against the current development DB structure. All of this structure is put in place to allow you to pre-define this information and not have to change code when it''s used in different environments. -- -- Tom Mornini --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Pål Bergström
2006-Aug-22 10:20 UTC
[Rails] Re: Development, test and production - what for?
Jan Prill wrote: Well explained. Thank you (and Tom). The database names says it all, I know. :-) Perhaps I should have asked how they are "managed". What happens when using the rake to create the db? Will that add or change in them all? (I could also try this so you don''t have to answer, if you don''t feel like it) -- 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 -~----------~----~----~----~------~----~------~--~---
Pål Bergström
2006-Aug-22 10:45 UTC
[Rails] Re: Development, test and production - what for?
Pål Bergström wrote:>What happens when > using the rake to create the db? Will that add or change in them all? (I > could also try this so you don''t have to answer, if you don''t feel like > it)And no. It doesn''t. Stupid question I guess. A change in development shouldn''t affect production mode instantly. But how then do you use the others? Will a rake command automatically add the stuff from development to production, when ready? Or how does it work? -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Tom Mornini
2006-Aug-22 14:46 UTC
[Rails] Re: Development, test and production - what for?
On Aug 22, 2006, at 3:45 AM, Pål Bergström wrote:> Pål Bergström wrote: >> What happens when >> using the rake to create the db? Will that add or change in them >> all? (I >> could also try this so you don''t have to answer, if you don''t feel >> like >> it) > > And no. It doesn''t. Stupid question I guess. A change in development > shouldn''t affect production mode instantly. > > But how then do you use the others? Will a rake command automatically > add the stuff from development to production, when ready? Or how > does it > work?Migrations are technology sufficiently advanced as to appear to be magic. :-) -- -- Tom Mornini --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---