Running db:migrate on production

Hello all,

What are your experience and thoughts on running migrates on a
production environment?
Since Rake is using the configuration from database.yml it uses the same
username as my Rails app. So if my migrates are altering the database
(add columns, etc.) this user has to be granted with drop, create and
alter rights.
But when running the Rails application I want this user to only have
enough right to perform SQL actions.

At the moment I’m thinking about executing the migrates in a
pre-production environment and then exporting the database.

On 2/15/07, Patrick B. [email protected] wrote:

But when running the Rails application I want this user to only have
enough right to perform SQL actions.

I’m not sure if this would work or not, but couldn’t you create a
separate
environment to run your migrations in? Add another entry to
database.ymlfor that environment with the production database and a
different username.

Then all you need to do is force you migrations to run in this “new”
environment.

Not exactly sure how to make all this work, but it seems like it should
be
feasible.

At the moment I’m thinking about executing the migrates in a

pre-production environment and then exporting the database.


Posted via http://www.ruby-forum.com/.

HTH,
Michael G.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs