I am upgrading to version 0.9 of rails. I saw that we now have three environments. I am trying to get a bit of clarification on how these environments work. I understand the performance tradeoffs between the development and production environment. I also understand the testing environment is used for unit testing. My current development involves me changing data in a database that only exists as a production database. Because of external dependencies we cannot really create a "development" database. I want to run the code in "development" mode (i.e. things are reloaded and error messages are sent to HTML output at all times) but I want it to operate on the production database. Now the obvious answer is to set both the production and development environment to point to the production database. But I remember reading a warning about setting the production and test environment to the same database because the unit testing will clear out the data in the testing database. My question is there any clearing out on the development server that takes place or is the data as safe as the code will allow? My assumption is that I can point them both to the same database, but I wanted to make sure. Eric _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
On Tue, 21 Dec 2004 13:53:26 -0500, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote:> Now the obvious answer is to set both the production and development > environment to point to the production database. But I remember reading > a warning about setting the production and test environment to the same > database because the unit testing will clear out the data in the testing > database. My question is there any clearing out on the development > server that takes place or is the data as safe as the code will allow? > My assumption is that I can point them both to the same database, but I > wanted to make sure.AFAIK, you should be fine pointing development and production to the same DB. I''ve been doing so since upgrading some of my projects, and I''ve noticed no problems. -- Regards, John Wilger ----------- Alice came to a fork in the road. "Which road do I take?" she asked. "Where do you want to go?" responded the Cheshire cat. "I don''t know," Alice answered. "Then," said the cat, "it doesn''t matter." - Lewis Carrol, Alice in Wonderland
On Tue, 21 Dec 2004 13:53:26 -0500, Eric Anderson <eric-ANzg6odk14w@public.gmane.org> wrote:> I am upgrading to version 0.9 of rails. I saw that we now have three > environments. I am trying to get a bit of clarification on how these > environments work. > > I understand the performance tradeoffs between the development and > production environment. I also understand the testing environment is > used for unit testing. My current development involves me changing data > in a database that only exists as a production database. Because of > external dependencies we cannot really create a "development" database. > I want to run the code in "development" mode (i.e. things are reloaded > and error messages are sent to HTML output at all times) but I want it > to operate on the production database. > > Now the obvious answer is to set both the production and development > environment to point to the production database. But I remember reading > a warning about setting the production and test environment to the same > database because the unit testing will clear out the data in the testing > database. My question is there any clearing out on the development > server that takes place or is the data as safe as the code will allow? > My assumption is that I can point them both to the same database, but I > wanted to make sure. > > Eric > >Unit tests are generally done on the testing database, which is different from the development database.
Joe Van Dyk wrote:> Unit tests are generally done on the testing database, which is > different from the development database.Yea I know the unit testing isn''t being run. I just wanted to make sure some similar zapping of data wasn''t associated with the development environment. Sounds like it is safe. Thanks, Eric _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
> Yea I know the unit testing isn''t being run. I just wanted to make > sure some similar zapping of data wasn''t associated with the > development environment. Sounds like it is safe.It is safe. No zapping. -- David Heinemeier Hansson, http://www.basecamphq.com/ -- Web-based Project Management http://www.rubyonrails.org/ -- Web-application framework for Ruby http://macromates.com/ -- TextMate: Code and markup editor (OS X) http://www.loudthinking.com/ -- Broadcasting Brain
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 John Wilger wrote:> AFAIK, you should be fine pointing development and production to the > same DB. I''ve been doing so since upgrading some of my projects, and > I''ve noticed no problems.You can even use an alias in database.yml development: production production: ... This also allows goodies like: test: test-sqlite test-mysql: ... test-postgres: ... test-sqlite: adapter: sqlite dbfile: db/test.db Best, jeremy -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFByIIZAQHALep9HFYRAsdBAKDKFVQ52LN4sUfcAG88zGsB6XEDtwCdHA3N qZHfuXm8nUG4OdG4P6qhEP4=cvL2 -----END PGP SIGNATURE-----