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('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

@ -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

@ -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;