diff --git a/application/models/airtime/map/CcShowDaysTableMap.php b/application/models/airtime/map/CcShowDaysTableMap.php index 333934c44..2e932e7eb 100644 --- a/application/models/airtime/map/CcShowDaysTableMap.php +++ b/application/models/airtime/map/CcShowDaysTableMap.php @@ -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() diff --git a/application/models/airtime/om/BaseCcShowDays.php b/application/models/airtime/om/BaseCcShowDays.php index 248abdb94..3a2d48f37 100644 --- a/application/models/airtime/om/BaseCcShowDays.php +++ b/application/models/airtime/om/BaseCcShowDays.php @@ -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); diff --git a/build/sql/schema.sql b/build/sql/schema.sql index 7d33355d9..6bdc5351d 100644 --- a/build/sql/schema.sql +++ b/build/sql/schema.sql @@ -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") ); diff --git a/install/airtime-upgrade.php b/install/airtime-upgrade.php index 6db722fa2..a84617321 100644 --- a/install/airtime-upgrade.php +++ b/install/airtime-upgrade.php @@ -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;