From d152b872482e9181ebf56215557146438c92217b Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Wed, 26 Jan 2011 19:20:19 +0100 Subject: [PATCH] Print the migration direction only once. --- horde/bin/db_migrate | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/horde/bin/db_migrate b/horde/bin/db_migrate index 6c6a5bf12..32241664e 100755 --- a/horde/bin/db_migrate +++ b/horde/bin/db_migrate @@ -86,6 +86,20 @@ if (!empty($args[2]) && strpos($args[2], 'debug') !== false) { $db->setLogger($logger); } +switch ($action) { +case 'up': + $cli->message('Migrating DB up.'); + break; + +case 'down': + $cli->message('Migrating DB down.'); + break; + +case 'migrate': + $cli->message('Migrating DB to schema version ' . $targetVersion . '.'); + break; +} + foreach ($apps as $key => $app) { $migrator = new Horde_Db_Migration_Migrator($db, $logger, array('migrationsPath' => $dirs[$key], 'schemaTableName' => $app . '_schema_info')); @@ -94,17 +108,14 @@ foreach ($apps as $key => $app) { try { switch ($action) { case 'up': - $cli->message('Migrating DB up.'); $migrator->up(); break; case 'down': - $cli->message('Migrating DB down.'); $migrator->down(); break; case 'migrate': - $cli->message('Migrating DB to schema version ' . $targetVersion . '.'); $migrator->migrate($targetVersion); break; } -- 2.11.0