CC-2141 : Upgrade support for Airtime 1.7

This commit is contained in:
Naomi 2011-03-31 17:21:06 -04:00
parent 953456e709
commit 19e75a3756
4 changed files with 33 additions and 3 deletions

View File

@ -47,7 +47,7 @@ class CcShowDaysTableMap extends TableMap {
$this->addColumn('REPEAT_TYPE', 'DbRepeatType', 'TINYINT', true, null, null); $this->addColumn('REPEAT_TYPE', 'DbRepeatType', 'TINYINT', true, null, null);
$this->addColumn('NEXT_POP_DATE', 'DbNextPopDate', 'DATE', false, 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->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 // validators
} // initialize() } // initialize()

View File

@ -80,6 +80,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
/** /**
* The value for the record field. * The value for the record field.
* Note: this column has a database default value of: 0
* @var int * @var int
*/ */
protected $record; protected $record;
@ -103,6 +104,27 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
*/ */
protected $alreadyInValidation = false; 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. * Get the [id] column value.
* *
@ -607,7 +629,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$v = (int) $v; $v = (int) $v;
} }
if ($this->record !== $v) { if ($this->record !== $v || $this->isNew()) {
$this->record = $v; $this->record = $v;
$this->modifiedColumns[] = CcShowDaysPeer::RECORD; $this->modifiedColumns[] = CcShowDaysPeer::RECORD;
} }
@ -625,6 +647,10 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
*/ */
public function hasOnlyDefaultValues() public function hasOnlyDefaultValues()
{ {
if ($this->record !== 0) {
return false;
}
// otherwise, everything was equal, so return TRUE // otherwise, everything was equal, so return TRUE
return true; return true;
} // hasOnlyDefaultValues() } // hasOnlyDefaultValues()
@ -1357,6 +1383,7 @@ abstract class BaseCcShowDays extends BaseObject implements Persistent
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->alreadyInValidation = false; $this->alreadyInValidation = false;
$this->clearAllReferences(); $this->clearAllReferences();
$this->applyDefaultValues();
$this->resetModified(); $this->resetModified();
$this->setNew(true); $this->setNew(true);
$this->setDeleted(false); $this->setDeleted(false);

View File

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

View File

@ -21,6 +21,9 @@ AirtimeInstall::MigrateTables(__DIR__);
echo PHP_EOL."*** Updating Pypo ***".PHP_EOL; echo PHP_EOL."*** Updating Pypo ***".PHP_EOL;
system("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py"); 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; echo "******************************* Update Complete *******************************".PHP_EOL;