rake db:migrate doesn't export anything, it recreates the schema from the 
defined migrations. At the end of running migrations it exports ONLY the DDL to 
recreate the same schema that the migrations just created, to be utilized by 
the test suite and rake db:reset. 

As I mentioned before importing default data is what rake db:seeds is for.  (or 
some other custom rake task you build)

Re deploy:cold

The difference between deploy and deploy:cold is minor but can be useful. 

deploy calls deploy:restart where deploy:cold calls deploy:start

Which is to start things that may not be restart-able.  I generally find it 
preferable to call deploy.restart inside deploy.start instead and I create a 
restart in cap for those dependencies that don't have a native restart. 

The only such dependency that I can recall is cruisecontrol.rb that only 
supplied a start or stop in their init script. Either you can push a better 
init script or you can manage it in cap. 

task :restart, :roles => :app do
  sudo "/etc/init.d/cruise stop;true"
  sudo "/etc/init.d/cruise start"
end

I consider deploy:cold destructive. So that's where I put db:resets and 
db:seeds, so I have an easy way to init or re-init a stage. FYI db:reset calls 
db:seeds internally so you only need to plumb db:reset as long as you've been 
checking in the schema.rb. 

I don't like checking in the schema.rb it's rife with conflicts and things from 
other branches sneak in. So I usually override db:reset to call db:migrate and 
gitignore the schema.rb

Also I usually start the cold task with a 

namespace :deploy do
  task :warn do
    raise Capistrano::Error, "you can't do this" if rails_env == "production"
  end
end
before "deploy:cold","deploy:warn"

And manually remark it If really do need to do it the first time on production. 

On Dec 7, 2011, at 2:33 AM, jay parteek <[email protected]> wrote:

> I got you. So rake db:migrate will just try to export the structure of
> the database placed inside the schema.rb.  What if we want to copy the
> local state (may be some dummy data ) to the remote server?
> 
> 
> 
> On Wed, Dec 7, 2011 at 2:21 AM, Lee Hambley <[email protected]> wrote:
>> Jay, What exactly do you expect rake db:migrate does? It simply runs your
>> migrations, it does not copy local state, and images to the remote server,
>> that wouldn't make any sense.
>> 
>> --
>> * You received this message because you are subscribed to the Google Groups
>> "Capistrano" group.
>> * To post to this group, send email to [email protected]
>> * To unsubscribe from this group, send email to
>> [email protected] For more options, visit this group
>> at http://groups.google.com/group/capistrano?hl=en
> 
> -- 
> * You received this message because you are subscribed to the Google Groups 
> "Capistrano" group.
> * To post to this group, send email to [email protected]
> * To unsubscribe from this group, send email to 
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/capistrano?hl=en

-- 
* You received this message because you are subscribed to the Google Groups 
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to 
[email protected] For more options, visit this group at 
http://groups.google.com/group/capistrano?hl=en

Reply via email to