On Dec 17, 2010, at 10:58 AM, Marnen Laibow-Koser wrote:

"Gustavo de Sá Carvalho Honorato" <gustavohonorato wrote in post
#969077:
On Fri, Dec 17, 2010 at 12:55 PM, Marnen Laibow-Koser
<li...@ruby-forum.com>wrote:

"Gustavo de S Carvalho Honorato" <gustavohonorato wrote in post
#969047:
Hello,

What are the good practices to deploy an Rails database in production?
It is
said that is unsafe to run database migrations in a production database,

That's ridiculous.  Where did you get that information?


Yes, I agree with you. It's very strange, but I saw this information in
comments of generated schema.rb.

You're misinterpreting those comments.


# This file is auto-generated from the current state of the database.
Instead of editing this file,
# please use the migrations feature of Active Record to incrementally
modify
your database, and
# then regenerate this schema definition.

In other words, don't edit this file manually; let the schema dumper do
it.

#
# Note that this schema.rb definition is the authoritative source for
your
database schema. If you need
# to create the application database on another system,

Note: *create* the application DB, not *update* it.

you should be
using
db:schema:load, not running
# all the migrations from scratch.

Note: *from scratch*.  This only applies when you are creating the DB
for the first time.

The latter is a flawed and
unsustainable
approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for
issues).

That is correct.

*BUT* if your migrations do anything that doesn't get captured into db/ schema.rb, then you need to either use :sql for the dump (db/ schema.sql) or you *DO* want to run all the migrations to initialize.


#
# It's strongly recommended to check this file into your version control
system.

There is nothing here about not using migrations on the production
database once it's been created.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
mar...@marnen.org

--

Rob Biedenharn          
r...@agileconsultingllc.com     http://AgileConsultingLLC.com/
r...@gaslightsoftware.com               http://GaslightSoftware.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-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to