Merge branch 'master' of dev.sourcefabric.org:airtime

This commit is contained in:
martin 2011-03-31 17:31:06 -04:00
commit 1c8a9a88ae
7 changed files with 130 additions and 25 deletions

View File

@ -47,7 +47,7 @@ class CcShowDaysTableMap extends TableMap {
$this->addColumn('REPEAT_TYPE', 'DbRepeatType', 'TINYINT', true, null, null);
$this->addColumn('NEXT_POP_DATE', 'DbNextPopDate', 'DATE', false, null, null);
$this->addForeignKey('SHOW_ID', 'DbShowId', 'INTEGER', 'cc_show', 'ID', true, null, null);
$this->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, null);
$this->addColumn('RECORD', 'DbRecord', 'TINYINT', false, null, 0);
// validators
} // initialize()

View File

@ -80,6 +80,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
/**
* The value for the record field.
* Note: this column has a database default value of: 0
* @var int
*/
protected $record;
@ -103,6 +104,27 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
*/
protected $alreadyInValidation = false;
/**
* Applies default values to this object.
* This method should be called from the object's constructor (or
* equivalent initialization method).
* @see __construct()
*/
public function applyDefaultValues()
{
$this->record = 0;
}
/**
* Initializes internal state of BaseCcShowDays object.
* @see applyDefaults()
*/
public function __construct()
{
parent::__construct();
$this->applyDefaultValues();
}
/**
* Get the [id] column value.
*
@ -607,7 +629,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$v = (int) $v;
}
if ($this->record !== $v) {
if ($this->record !== $v || $this->isNew()) {
$this->record = $v;
$this->modifiedColumns[] = CcShowDaysPeer::RECORD;
}
@ -625,6 +647,10 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
*/
public function hasOnlyDefaultValues()
{
if ($this->record !== 0) {
return false;
}
// otherwise, everything was equal, so return TRUE
return true;
} // hasOnlyDefaultValues()
@ -1357,6 +1383,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$this->alreadyInSave = false;
$this->alreadyInValidation = false;
$this->clearAllReferences();
$this->applyDefaultValues();
$this->resetModified();
$this->setNew(true);
$this->setDeleted(false);

View File

@ -152,7 +152,7 @@
<column name="repeat_type" phpName="DbRepeatType" type="TINYINT" required="true"/>
<column name="next_pop_date" phpName="DbNextPopDate" type="DATE" required="false"/>
<column name="show_id" phpName="DbShowId" type="INTEGER" required="true"/>
<column name="record" phpName="DbRecord" type="TINYINT" required="false"/>
<column name="record" phpName="DbRecord" type="TINYINT" required="false" defaultValue="0"/>
<foreign-key foreignTable="cc_show" name="cc_show_fkey" onDelete="CASCADE">
<reference local="show_id" foreign="id"/>
</foreign-key>

View File

@ -195,7 +195,7 @@ CREATE TABLE "cc_show_days"
"repeat_type" INT2 NOT NULL,
"next_pop_date" DATE,
"show_id" INTEGER NOT NULL,
"record" INT2,
"record" INT2 default 0,
PRIMARY KEY ("id")
);

View File

@ -1,21 +0,0 @@
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema;
class Version20110308003959 extends AbstractMigration
{
public function up(Schema $schema)
{
$table = $schema->getTable("cc_show_instances");
$table->addColumn("record", "boolean", array( 'notnull' => 0, 'default' => 0));
}
public function down(Schema $schema)
{
$table = $schema->getTable("cc_show_instances");
$table->dropColumn("record");
}
}

View File

@ -0,0 +1,96 @@
<?php
namespace DoctrineMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema,
Doctrine\DBAL\Schema\Table,
Doctrine\DBAL\Schema\Column,
Doctrine\DBAL\Types\Type;
class Version20110331111708 extends AbstractMigration
{
public function up(Schema $schema)
{
//start cc_show_instances modifications
$show_instances_table = $schema->getTable('cc_show_instances');
$show_instances_table->addColumn('record', 'smallint', array('notnull' => 0, 'default' => 0));
$show_instances_table->addColumn('rebroadcast', 'smallint', array('notnull' => 0, 'default' => 0));
$show_instances_table->addColumn('instance_id', 'integer', array('notnull' => 0));
$show_instances_table->addColumn('file_id', 'integer', array('notnull' => 0));
$show_instances_table->addColumn('soundcloud_id', 'integer', array('notnull' => 0));
$show_instances_table->addNamedForeignKeyConstraint('cc_original_show_instance_fkey', $show_instances_table, array('instance_id'), array('id'), array('onDelete' => 'CASCADE'));
$files_table = $schema->getTable('cc_files');
$show_instances_table->addNamedForeignKeyConstraint('cc_recorded_file_fkey', $files_table, array('file_id'), array('id'), array('onDelete' => 'CASCADE'));
//end cc_show_instances modifications
//start cc_show_days modifications
$show_days_table = $schema->getTable('cc_show_days');
$show_days_table->addColumn('record', 'smallint', array( 'notnull' => 0, 'default' => 0));
//end cc_show_days modifications
//start cc_show modifications
$show_table = $schema->getTable('cc_show');
$show_table->addColumn('url', 'string', array('notnull' => 0, 'length' => 255));
//end cc_show modifications
//start cc_schedule modifications
$schedule_table = $schema->getTable('cc_schedule');
$playlist_id_col = $schedule_table->getColumn('playlist_id');
$playlist_id_col->setNotnull(false);
//end cc_schedule modifications
//create cc_show_rebroadcast table
$cc_show_rebroadcast_table = $schema->createTable('cc_show_rebroadcast');
$cc_show_rebroadcast_table->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true));
$cc_show_rebroadcast_table->addColumn('day_offset', 'string', array('length' => 255));
$cc_show_rebroadcast_table->addColumn('start_time', 'datetime', array('notnull' => 1));
$cc_show_rebroadcast_table->addColumn('show_id', 'integer', array('notnull' => 1));
$cc_show_rebroadcast_table->setPrimaryKey(array('id'));
//end create cc_show_rebroadcast table
}
public function down(Schema $schema)
{
//start cc_show_instances modifications
$show_instances_table = $schema->getTable('cc_show_instances');
$show_instances_table->dropColumn('record');
$show_instances_table->dropColumn('rebroadcast');
$show_instances_table->dropColumn('instance_id');
$show_instances_table->dropColumn('file_id');
$show_instances_table->dropColumn('soundcloud_id');
//end cc_show_instances modifications
//start cc_show_days modifications
$show_days_table = $schema->getTable('cc_show_days');
$show_days_table->dropColumn('record');
//end cc_show_days modifications
//start cc_show modifications
$show_table = $schema->getTable('cc_show');
$show_table->dropColumn('url');
//end cc_show modifications
//start cc_schedule modifications
$schedule_table = $schema->getTable('cc_schedule');
$playlist_id_col = $schedule_table->getColumn('playlist_id');
$playlist_id_col->setNotnull(true);
//end cc_schedule modifications
//drop cc_show_rebroadcast table
$schema->dropTable('cc_show_rebroadcast');
//end drop cc_show_rebroadcast table
}
}

View File

@ -21,6 +21,9 @@ 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");
echo "******************************* Update Complete *******************************".PHP_EOL;