CC-2172 : Create Upgrade structure so that a user can upgrade from any version of Airtime properly

This commit is contained in:
Naomi 2011-04-08 11:44:53 -04:00
parent 908aa890fe
commit 976dda339a
3 changed files with 53 additions and 11 deletions

View File

@ -7,22 +7,13 @@
*/
require_once(dirname(__FILE__).'/include/AirtimeIni.php');
require_once(dirname(__FILE__).'/include/AirtimeInstall.php');
AirtimeIni::ExitIfNotRoot();
echo "******************************** Update Begin *********************************".PHP_EOL;
AirtimeIni::CreateIniFile();
AirtimeIni::UpdateIniFiles();
echo PHP_EOL."*** Updating Database Tables ***".PHP_EOL;
AirtimeInstall::MigrateTables(__DIR__);
echo PHP_EOL."*** Updating Pypo ***".PHP_EOL;
system("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py");
echo PHP_EOL."*** Recorder Installation ***".PHP_EOL;
system("python ".__DIR__."/../python_apps/show-recorder/install/recorder-install.py");
system("php ".__DIR__."/upgrades/airtime-1.7/airtime-upgrade.php");
system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
echo "******************************* Update Complete *******************************".PHP_EOL;

View File

@ -0,0 +1,23 @@
<?php
/**
* @package Airtime
* @subpackage StorageServer
* @copyright 2010 Sourcefabric O.P.S.
* @license http://www.gnu.org/licenses/gpl.txt
*/
require_once(dirname(__FILE__).'/../../include/AirtimeIni.php');
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
AirtimeIni::CreateIniFile();
AirtimeIni::UpdateIniFiles();
echo PHP_EOL."*** Updating Database Tables ***".PHP_EOL;
AirtimeInstall::MigrateTables(__DIR__);
echo PHP_EOL."*** Updating Pypo ***".PHP_EOL;
system("python ".__DIR__."/../../../python_apps/pypo/install/pypo-install.py");
echo PHP_EOL."*** Recorder Installation ***".PHP_EOL;
system("python ".__DIR__."/../../../python_apps/show-recorder/install/recorder-install.py");

View File

@ -0,0 +1,28 @@
<?php
/**
* @package Airtime
* @subpackage StorageServer
* @copyright 2010 Sourcefabric O.P.S.
* @license http://www.gnu.org/licenses/gpl.txt
*/
set_include_path(__DIR__.'/../../../library' . PATH_SEPARATOR . get_include_path());
require_once __DIR__.'/../../../application/configs/conf.php';
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
echo PHP_EOL."*** Updating Database Tables ***".PHP_EOL;
AirtimeInstall::MigrateTables(__DIR__);
//setting data for new aggregate show length column.
AirtimeInstall::DbConnect(true);
$sql = "SELECT id FROM cc_show_instances";
$show_instances = $CC_DBC->GetAll($sql);
foreach ($show_instances as $show_instance) {
$sql = "UPDATE cc_show_instances SET time_filled = (SELECT SUM(clip_length) FROM cc_schedule WHERE instance_id = {$show_instance}) WHERE id = {$show_instance}";
$CC_DBC->query($sql);
}
//end setting data for new aggregate show length column.