From 0af749dd2000f2b80344c89a6d74037af5a5e08e Mon Sep 17 00:00:00 2001 From: martin Date: Tue, 4 Oct 2011 15:40:58 -0400 Subject: [PATCH] CC-2806: Create upgrade template file -minor tweaks --- .../upgrades/upgrade-template/UpgradeCommon.php | 2 +- .../upgrades/upgrade-template/airtime-upgrade.php | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/install_minimal/upgrades/upgrade-template/UpgradeCommon.php b/install_minimal/upgrades/upgrade-template/UpgradeCommon.php index 57ee794cd..c106ee4b0 100644 --- a/install_minimal/upgrades/upgrade-template/UpgradeCommon.php +++ b/install_minimal/upgrades/upgrade-template/UpgradeCommon.php @@ -70,7 +70,7 @@ class UpgradeCommon{ } } - $default_suffix = "200"; + $default_suffix = CONF_BACKUP_SUFFIX; self::CreateIniFiles($default_suffix); self::MergeConfigFiles($configFiles, $suffix); } diff --git a/install_minimal/upgrades/upgrade-template/airtime-upgrade.php b/install_minimal/upgrades/upgrade-template/airtime-upgrade.php index 42aa0c287..5812e84ac 100644 --- a/install_minimal/upgrades/upgrade-template/airtime-upgrade.php +++ b/install_minimal/upgrades/upgrade-template/airtime-upgrade.php @@ -16,6 +16,7 @@ */ const VERSION_NUMBER = "2.0.0"; +const CONF_BACKUP_SUFFIX = "200"; set_include_path(__DIR__.'/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path()); set_include_path(__DIR__.'/../../../airtime_mvc/library/pear' . PATH_SEPARATOR . get_include_path()); @@ -28,6 +29,8 @@ Propel::init(__DIR__."/../../../airtime_mvc/application/configs/airtime-conf.php require_once 'UpgradeCommon.php'; +$bypassMigrations=array('20110312121200', '20110331111708', '20110402164819', '20110406182005', '20110629143017', '20110711161043', '20110713161043'); +$targetMigration='20110925171256'; /* All functions other than start() should be marked as * private. @@ -39,14 +42,14 @@ class AirtimeDatabaseUpgrade{ } private static function doDbMigration(){ + global $bypassMigrations, $targetMigration; if(UpgradeCommon::DbTableExists('doctrine_migration_versions') === false) { - $migrations = array('20110312121200', '20110331111708', '20110402164819', '20110406182005', '20110629143017', '20110711161043', '20110713161043'); - foreach($migrations as $migration) { + foreach($bypassMigrations as $migration) { UpgradeCommon::BypassMigrations(__DIR__, $migration); } } - UpgradeCommon::MigrateTablesToVersion(__DIR__, '20110925171256'); + UpgradeCommon::MigrateTablesToVersion(__DIR__, $targetMigration); } } @@ -70,7 +73,7 @@ class AirtimeConfigFileUpgrade{ * 3 classes. For example, there may be stray files scattered throughout * the filesystem that we don't need anymore. Put the functions to clean * those out into this class. */ -class AirtimeMiscUpgrade{1 +class AirtimeMiscUpgrade{ public static function start(){ }