Skip to content

Commit

Permalink
Merge pull request #560 from rolebi/patch-1
Browse files Browse the repository at this point in the history
Allow usage of doctrine migrations names containing description
  • Loading branch information
willdurand committed Apr 29, 2015
2 parents e07a5a9 + f68216d commit 1821cac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/symfony2/doctrine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
task :migrate, :roles => :app, :only => { :primary => true }, :except => { :no_release => true } do
currentVersion = nil
run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} --no-ansi doctrine:migrations:status #{console_options}#{doctrine_em_flag}'", :once => true do |ch, stream, out|
if stream == :out and out =~ /Current Version:.+\(([\w]+)\)/
if stream == :out and out =~ /Current Version:.+\(([^\)]+)\)/
currentVersion = Regexp.last_match(1)
end
if stream == :out and out =~ /Current Version:\s*0\s*$/
Expand All @@ -119,8 +119,8 @@
logger.info " Current database version: #{currentVersion}"

on_rollback {
if !interactive_mode || Capistrano::CLI.ui.agree("Do you really want to migrate #{symfony_env_prod}'s database back to version #{currentVersion}? (y/N)")
run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:migrations:migrate #{currentVersion} #{console_options} --no-interaction#{doctrine_em_flag}'", :once => true
if !interactive_mode || Capistrano::CLI.ui.agree("Do you really want to migrate #{symfony_env_prod}'s database back to version \"#{currentVersion}\"? (y/N)")
run "#{try_sudo} sh -c 'cd #{latest_release} && #{php_bin} #{symfony_console} doctrine:migrations:migrate \"#{currentVersion}\" #{console_options} --no-interaction#{doctrine_em_flag}'", :once => true
end
}

Expand Down

0 comments on commit 1821cac

Please sign in to comment.