CC-3605 : Create 2.1 upgrades
This commit is contained in:
parent
bcc30b9cb1
commit
c2ce50bf46
|
@ -8,26 +8,46 @@ class AirtimeDatabaseUpgrade{
|
||||||
public static function start(){
|
public static function start(){
|
||||||
echo "* Updating Database".PHP_EOL;
|
echo "* Updating Database".PHP_EOL;
|
||||||
self::task0();
|
self::task0();
|
||||||
|
self::task1();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function task0(){
|
private static function task0(){
|
||||||
UpgradeCommon::MigrateTablesToVersion(__DIR__, '20120410143340');
|
UpgradeCommon::MigrateTablesToVersion(__DIR__, '20120411102907');
|
||||||
|
|
||||||
$sql = "INSERT INTO cc_pref(\"keystr\", \"valstr\") VALUES('scheduled_play_switch', 'on')";
|
$sql = "INSERT INTO cc_pref(\"keystr\", \"valstr\") VALUES('scheduled_play_switch', 'on')";
|
||||||
UpgradeCommon::nonSelectQueryDb($sql);
|
UpgradeCommon::nonSelectQueryDb($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* set values for playout_status in cc_schedule
|
||||||
|
*/
|
||||||
|
private static function task1() {
|
||||||
|
|
||||||
|
// Define path to application directory
|
||||||
|
defined('APPLICATION_PATH')
|
||||||
|
|| define('APPLICATION_PATH', realpath(__DIR__."/../../application"));
|
||||||
|
|
||||||
|
// Ensure library is on include_path
|
||||||
|
set_include_path(implode(PATH_SEPARATOR, array(
|
||||||
|
get_include_path(),
|
||||||
|
realpath(APPLICATION_PATH . '/../library')
|
||||||
|
)));
|
||||||
|
|
||||||
|
//Propel classes.
|
||||||
|
set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
|
||||||
|
|
||||||
require_once 'propel/runtime/lib/Propel.php';
|
require_once 'propel/runtime/lib/Propel.php';
|
||||||
Propel::init(__DIR__."/../../configs/airtime-conf-production.php");
|
Propel::init(APPLICATION_PATH."/configs/airtime-conf-production.php");
|
||||||
|
|
||||||
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
|
$con = Propel::getConnection(CcSchedulePeer::DATABASE_NAME);
|
||||||
|
|
||||||
$showInstances = CcShowInstancesQuery::create()
|
$showInstances = CcShowInstancesQuery::create()
|
||||||
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)
|
||||||
->filterByDbStarts(Criteria::GREATER_EQUAL)
|
->filterByDbStarts(Criteria::GREATER_EQUAL)
|
||||||
->find($con);
|
->find($con);
|
||||||
|
|
||||||
foreach ($showInstances as $instance) {
|
foreach ($showInstances as $instance) {
|
||||||
$instance->updateScheduleStatus($con);
|
$instance->updateScheduleStatus($con);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue