title: Multistaging capistrano: db:migrate working correctly on production but not on staging
body: <p>I have set up capistrano to deploy to staging and production. Honestly, I'm not very familiar with capistrano. I did this via just using standard capistrano (not multi-host). I pass a variable in such as:</p>
  
  <pre><code>cap production deploy
  cap staging deploy
  </code></pre>
  
  <p>But my <code>db:migrate</code> isn't working correcty. </p>
  
  <p>with cat staging deploy:
  I get shis:</p>
  
  <pre><code>  * executing "cd /data/sites/staging.domain.com/apps/d-rails/releases/20121212203353 &amp;&amp; bundle exec rake RAILS_ENV=production  db:migrate"
  </code></pre>
  
  <p>and would like (just sub production -> staging):</p>
  
  <pre><code>* executing "cd /data/sites/staging.domain.com/apps/d-rails/releases/20121212203353 &amp;&amp; bundle exec rake RAILS_ENV=staging  db:migrate"
  </code></pre>
  
  <p>How would I set this up? Or what should I look at first to fix?</p>
  
  <p>In my deploy.rb, I have:</p>
  
  <pre><code>task :production do
    set :deploy_to, "/data/sites/domain.com/apps/#{application}"
  end
  
  task :staging do
    set :deploy_to, "/data/sites/staging.domain.com/apps/#{application}"
    after 'deploy:update_code' do
      run "cd #{release_path}; RAILS_ENV=staging bundle exec rake assets:precompile --trace"
    end
  end
  </code></pre>
  
  <p>thx in advance</p>