SAAS-628: Create script to update disk_usage for all Airtime pro stations
This commit is contained in:
parent
0d790213e3
commit
b398fea7e7
|
@ -19,6 +19,7 @@ class UpgradeController extends Zend_Controller_Action
|
||||||
array_push($upgraders, new AirtimeUpgrader255());
|
array_push($upgraders, new AirtimeUpgrader255());
|
||||||
array_push($upgraders, new AirtimeUpgrader259());
|
array_push($upgraders, new AirtimeUpgrader259());
|
||||||
array_push($upgraders, new AirtimeUpgrader2510());
|
array_push($upgraders, new AirtimeUpgrader2510());
|
||||||
|
array_push($upgraders, new AirtimeUpgrader2511());
|
||||||
|
|
||||||
$didWePerformAnUpgrade = false;
|
$didWePerformAnUpgrade = false;
|
||||||
try
|
try
|
||||||
|
|
|
@ -341,3 +341,44 @@ class AirtimeUpgrader2510 extends AirtimeUpgrader
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class AirtimeUpgrader2511 extends AirtimeUpgrader
|
||||||
|
{
|
||||||
|
protected function getSupportedVersions() {
|
||||||
|
return array (
|
||||||
|
'2.5.10'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNewVersion() {
|
||||||
|
return '2.5.11';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function upgrade($dir = __DIR__) {
|
||||||
|
Cache::clear();
|
||||||
|
assert($this->checkIfUpgradeSupported());
|
||||||
|
|
||||||
|
$newVersion = $this->getNewVersion();
|
||||||
|
|
||||||
|
try {
|
||||||
|
$this->toggleMaintenanceScreen(true);
|
||||||
|
Cache::clear();
|
||||||
|
|
||||||
|
// Begin upgrade
|
||||||
|
$queryResult = CcFilesQuery::create()
|
||||||
|
->select(array('disk_usage'))
|
||||||
|
->withColumn('SUM(CcFiles.filesize)', 'disk_usage')
|
||||||
|
->find();
|
||||||
|
$disk_usage = $queryResult[0];
|
||||||
|
Application_Model_Preference::setDiskUsage($disk_usage);
|
||||||
|
|
||||||
|
Application_Model_Preference::SetAirtimeVersion($newVersion);
|
||||||
|
Cache::clear();
|
||||||
|
|
||||||
|
$this->toggleMaintenanceScreen(false);
|
||||||
|
} catch(Exception $e) {
|
||||||
|
$this->toggleMaintenanceScreen(false);
|
||||||
|
throw $e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue