Nathan Esquenazi | 18 May 01:44

Re: Combine old migrations?


From schema.rb

# 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, you should be 
using db:schema:load, not running
# all the migrations from scratch. 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).

In short, one reason you don't really need to consolidate migrations is 
because when deploying a application to a new server, you should really 
not use db:migrate because it can be slow, amass alot of redundancy, 
etc. Loading the latest schema is a much better practice.

so when starting from scratch use:

rake db:schema:load

over

rake db:migrate

(in most cases)

That said, I don't think consolidating old migrations is necessarily bad 
if its a personal project and no one else is relying on the migrations.

In fact, before a project is deployed for release, I tend to use:

http://errtheblog.com/posts/65-automatically
--

-- 
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@...
To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Gmane