Topic: Basic Deployment / Production question

Hi, this is hopefully a simple question:

So far I've been running my app only in development mode.  I'm ready to run it in production mode.  What I have set up currently is the following:

mydomain.com  loads up the production environment
dev.mydomain.com  loads up the development environment

My question is this:  as I change code for this app, and create and modify the database structure, I would like to be able to test all those changes with the development environment and apply them to the production environment only when I know that they are working.  However, if I run "rake db:migrate", won't it update the development, testing, and production databases?  How can I tell it to only update the first two, and then update the third at a later stage?

How are you supposed to run a development and a testing environment at the same time on the same machine?

Re: Basic Deployment / Production question

Normally Rails uses a spearate database for the different environments. Check out the database.yml file, you can specify a different database to use for each environment. I believe "rake db:migrate" will only migrate the development database unless you specify elsewhere.

Railscasts - Free Ruby on Rails Screencasts

Re: Basic Deployment / Production question

set the environment variable

see the bottom of this page:
http://wiki.rubyonrails.org/rails/pages … Migrations

Last edited by drewt (2007-04-28 21:35:22)

Re: Basic Deployment / Production question

rake db:migrate runs in development mode.
To use the test environment
rake db:migrate RAILS_ENV=test

Re: Basic Deployment / Production question

Thanks all, your answers have been very helpful.