CC-3421: Upgrade Script: add/enhance upgrade script for network drive files handler feature
This commit is contained in:
parent
c5b761bff3
commit
3caa5adce2
|
@ -11,5 +11,6 @@ class AirtimeConfigFileUpgrade{
|
|||
}
|
||||
|
||||
private static function task0(){
|
||||
UpgradeCommon::upgradeConfigFiles();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ class AirtimeDatabaseUpgrade{
|
|||
}
|
||||
|
||||
private static function task0(){
|
||||
|
||||
UpgradeCommon::MigrateTablesToVersion(__DIR__, '20120402103944');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -14,8 +14,8 @@ class UpgradeCommon{
|
|||
|
||||
const CONF_PYPO_GRP = "pypo";
|
||||
const CONF_WWW_DATA_GRP = "www-data";
|
||||
const CONF_BACKUP_SUFFIX = "202";
|
||||
const VERSION_NUMBER = "2.0.2";
|
||||
const CONF_BACKUP_SUFFIX = "210";
|
||||
const VERSION_NUMBER = "2.1.0";
|
||||
|
||||
public static function SetDefaultTimezone()
|
||||
{
|
||||
|
@ -69,7 +69,7 @@ class UpgradeCommon{
|
|||
$appDir = self::GetAirtimeSrcDir();
|
||||
$command = "php --php-ini $dir/../../airtime-php.ini ".
|
||||
"$appDir/library/doctrine/migrations/doctrine-migrations.phar ".
|
||||
"--configuration=$dir/../../DoctrineMigrations/migrations.xml ".
|
||||
"--configuration=$dir/migrations.xml ".
|
||||
"--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ".
|
||||
"--no-interaction migrations:migrate $version";
|
||||
system($command);
|
||||
|
@ -80,7 +80,7 @@ class UpgradeCommon{
|
|||
$appDir = self::GetAirtimeSrcDir();
|
||||
$command = "php --php-ini $dir/../../airtime-php.ini ".
|
||||
"$appDir/library/doctrine/migrations/doctrine-migrations.phar ".
|
||||
"--configuration=$dir/../../DoctrineMigrations/migrations.xml ".
|
||||
"--configuration=$dir/migrations.xml ".
|
||||
"--db-configuration=$appDir/library/doctrine/migrations/migrations-db.php ".
|
||||
"--no-interaction --add migrations:version $version";
|
||||
system($command);
|
||||
|
@ -122,19 +122,19 @@ class UpgradeCommon{
|
|||
}
|
||||
}
|
||||
|
||||
if (!copy(__DIR__."/airtime.conf.$suffix", self::CONF_FILE_AIRTIME)){
|
||||
if (!copy(__DIR__."../etc/airtime.conf.$suffix", self::CONF_FILE_AIRTIME)){
|
||||
echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
if (!copy(__DIR__."/pypo.cfg.$suffix", self::CONF_FILE_PYPO)){
|
||||
if (!copy(__DIR__."../etc/pypo.cfg.$suffix", self::CONF_FILE_PYPO)){
|
||||
echo "Could not copy pypo.cfg to /etc/airtime/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
if (!copy(__DIR__."/media-monitor.cfg.$suffix", self::CONF_FILE_MEDIAMONITOR)){
|
||||
if (!copy(__DIR__."../etc/media-monitor.cfg.$suffix", self::CONF_FILE_MEDIAMONITOR)){
|
||||
echo "Could not copy meadia-monitor.cfg to /etc/airtime/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
if (!copy(__DIR__."/api_client.cfg.$suffix", self::CONF_FILE_API_CLIENT)){
|
||||
if (!copy(__DIR__."../etc/api_client.cfg.$suffix", self::CONF_FILE_API_CLIENT)){
|
||||
echo "Could not copy api_client.cfg to /etc/monit/conf.d/. Exiting.";
|
||||
exit(1);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Migrations\AbstractMigration,
|
||||
Doctrine\DBAL\Schema\Schema;
|
||||
|
||||
class Version20120402103944 extends AbstractMigration
|
||||
{
|
||||
public function up(Schema $schema)
|
||||
{
|
||||
$cc_music_dirs = $schema->getTable('cc_music_dirs');
|
||||
$cc_music_dirs->addColumn('watched', 'boolean', array('default'=> 'true'));
|
||||
$cc_music_dirs->addColumn('exists', 'boolean', array('default'=> 'true'));
|
||||
|
||||
$cc_files = $schema->getTable('cc_files');
|
||||
$cc_files->addColumn('file_exists', 'boolean', array('default'=> 'true'));
|
||||
|
||||
$this->dropForeignKey('cc_files', 'cc_music_dirs_folder_fkey');
|
||||
$cc_files->addNamedForeignKeyConstraint('cc_music_dirs_folder_fkey', $cc_music_dirs, array('directory'), array('id'));
|
||||
$cc_files->addIndex('file_exists', 'cc_files_file_exists_idx');
|
||||
}
|
||||
|
||||
public function down(Schema $schema)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<doctrine-migrations xmlns="http://doctrine-project.org/schemas/migrations/configuration"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://doctrine-project.org/schemas/migrations/configuration
|
||||
http://doctrine-project.org/schemas/migrations/configuration.xsd">
|
||||
|
||||
<name>Airtime 2.0.0 Database Upgrade</name>
|
||||
|
||||
<migrations-namespace>DoctrineMigrations</migrations-namespace>
|
||||
|
||||
<table name="doctrine_migration_versions" />
|
||||
|
||||
<migrations-directory>./</migrations-directory>
|
||||
|
||||
</doctrine-migrations>
|
Loading…
Reference in New Issue