Permalink
Browse files

Fixing migrations commands

  • Loading branch information...
1 parent 5c6316d commit 9352408e8a36f154dd4ba8b0ced12971ca74bec9 @weaverryan weaverryan committed Jun 14, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/symfony2.rb
View
@@ -82,7 +82,7 @@
desc "Migrate Symfony2 Doctrine ORM database."
task :migrate do
currentVersion = nil
- run "#{php-bin} #{symfony_console} doctrine:migrations:status --env=#{symfony_env_prod}" do |ch, stream, out|
+ run "cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:migrations:status --env=#{symfony_env_prod}" do |ch, stream, out|
if stream == :out and out =~ /Current Version:[^$]+\(([0-9]+)\)/
currentVersion = Regexp.last_match(1)
end
@@ -98,12 +98,12 @@
on_rollback {
if Capistrano::CLI.ui.agree("Do you really want to migrate #{symfony_env_prod}'s database back to version #{currentVersion}? (y/N)")
- run "#{php-bin} #{symfony_console} doctrine:migrations:migrate #{currentVersion} --env=#{symfony_env_prod} --no-interaction"
+ run "cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:migrations:migrate #{currentVersion} --env=#{symfony_env_prod} --no-interaction"
end
}
if Capistrano::CLI.ui.agree("Do you really want to migrate #{symfony_env_prod}'s database? (y/N)")
- run "#{php-bin} #{symfony_console} doctrine:migrations:migrate --env=#{symfony_env_prod} --no-interaction"
+ run "cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:migrations:migrate --env=#{symfony_env_prod} --no-interaction"
end
end
end

1 comment on commit 9352408

Owner

everzet commented on 9352408 Jun 14, 2011

Nice. Merged and pushed to RubyGems. v2.0.9 ;-)

Please sign in to comment.