The problem is that I have a particular db migration task (I've taken
this application and I'm trying to understand it).

this taks is:

task :migrate_all, :roles => :db, :only => { :primary => true } do
    rake = fetch(:rake, "rake")
    rails_env = fetch(:rails_env, "production")
    migrate_env = fetch(:migrate_env, "")
    migrate_target = fetch(:migrate_target, :latest)

    directory = case migrate_target.to_sym
      when :current then current_path
      when :latest  then current_release
      else raise ArgumentError, "unknown migration target
#{migrate_target.inspect}"
      end

    run "cd #{directory}; #{rake} RAILS_ENV=#{rails_env}
#{migrate_env} app:migrate_db DB=production_customer_1"
    run "cd #{directory}; #{rake} RAILS_ENV=#{rails_env}
#{migrate_env} app:migrate_db DB=production_customer_2"

end

this task tries to run rake from the db host and clearly it fails.
If I set the  ":db role" to my webserver it fails because it doesn't
find mysql (what I don't understand is why it doesn't take the
production database host specified in the database.yml).

Any ideas?


On 16 Sep, 15:39, "Jonathan Weiss" <[EMAIL PROTECTED]> wrote:
> > 2 web server
> > 1 database server
>
> > Is it possible to configure capistrano in order to migrate the
> > database in my database server (only mysql is installed, not ruby, not
> > rake)?
> > Is enough to change the "role :db" host in the deploy.rb?
>
> Just set the :db role to one of your webservers. Capistrano doesn't
> need to know about the real DB server. It will run the migrations on
> the :db role.
>
> Jonathan
>
> --
> Jonathan Weisshttp://blog.innerewut.dehttp://twitter.com/jweiss

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to