-removing type column from cc_playlist

This commit is contained in:
James 2012-08-24 17:12:52 -04:00
parent 4406d26c95
commit bc660c4cdf
6 changed files with 14 additions and 102 deletions

View file

@ -45,7 +45,6 @@ class CcPlaylistTableMap extends TableMap {
$this->addForeignKey('CREATOR_ID', 'DbCreatorId', 'INTEGER', 'cc_subjs', 'ID', false, null, null); $this->addForeignKey('CREATOR_ID', 'DbCreatorId', 'INTEGER', 'cc_subjs', 'ID', false, null, null);
$this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null); $this->addColumn('DESCRIPTION', 'DbDescription', 'VARCHAR', false, 512, null);
$this->addColumn('LENGTH', 'DbLength', 'VARCHAR', false, null, '00:00:00'); $this->addColumn('LENGTH', 'DbLength', 'VARCHAR', false, null, '00:00:00');
$this->addColumn('TYPE', 'DbType', 'VARCHAR', false, 7, 'static');
// validators // validators
} // initialize() } // initialize()

View file

@ -68,13 +68,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
*/ */
protected $length; protected $length;
/**
* The value for the type field.
* Note: this column has a database default value of: 'static'
* @var string
*/
protected $type;
/** /**
* @var CcSubjs * @var CcSubjs
*/ */
@ -109,7 +102,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
{ {
$this->name = ''; $this->name = '';
$this->length = '00:00:00'; $this->length = '00:00:00';
$this->type = 'static';
} }
/** /**
@ -238,16 +230,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
return $this->length; return $this->length;
} }
/**
* Get the [type] column value.
*
* @return string
*/
public function getDbType()
{
return $this->type;
}
/** /**
* Set the value of [id] column. * Set the value of [id] column.
* *
@ -450,26 +432,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
return $this; return $this;
} // setDbLength() } // setDbLength()
/**
* Set the value of [type] column.
*
* @param string $v new value
* @return CcPlaylist The current object (for fluent API support)
*/
public function setDbType($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->type !== $v || $this->isNew()) {
$this->type = $v;
$this->modifiedColumns[] = CcPlaylistPeer::TYPE;
}
return $this;
} // setDbType()
/** /**
* Indicates whether the columns in this object are only set to default values. * Indicates whether the columns in this object are only set to default values.
* *
@ -488,10 +450,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
return false; return false;
} }
if ($this->type !== 'static') {
return false;
}
// otherwise, everything was equal, so return TRUE // otherwise, everything was equal, so return TRUE
return true; return true;
} // hasOnlyDefaultValues() } // hasOnlyDefaultValues()
@ -521,7 +479,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
$this->creator_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null; $this->creator_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
$this->description = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null; $this->description = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->length = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null; $this->length = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
$this->type = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
$this->resetModified(); $this->resetModified();
$this->setNew(false); $this->setNew(false);
@ -530,7 +487,7 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
$this->ensureConsistency(); $this->ensureConsistency();
} }
return $startcol + 8; // 8 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS). return $startcol + 7; // 7 = CcPlaylistPeer::NUM_COLUMNS - CcPlaylistPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) { } catch (Exception $e) {
throw new PropelException("Error populating CcPlaylist object", $e); throw new PropelException("Error populating CcPlaylist object", $e);
@ -896,9 +853,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
case 6: case 6:
return $this->getDbLength(); return $this->getDbLength();
break; break;
case 7:
return $this->getDbType();
break;
default: default:
return null; return null;
break; break;
@ -930,7 +884,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
$keys[4] => $this->getDbCreatorId(), $keys[4] => $this->getDbCreatorId(),
$keys[5] => $this->getDbDescription(), $keys[5] => $this->getDbDescription(),
$keys[6] => $this->getDbLength(), $keys[6] => $this->getDbLength(),
$keys[7] => $this->getDbType(),
); );
if ($includeForeignObjects) { if ($includeForeignObjects) {
if (null !== $this->aCcSubjs) { if (null !== $this->aCcSubjs) {
@ -988,9 +941,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
case 6: case 6:
$this->setDbLength($value); $this->setDbLength($value);
break; break;
case 7:
$this->setDbType($value);
break;
} // switch() } // switch()
} }
@ -1022,7 +972,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
if (array_key_exists($keys[4], $arr)) $this->setDbCreatorId($arr[$keys[4]]); if (array_key_exists($keys[4], $arr)) $this->setDbCreatorId($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbDescription($arr[$keys[5]]); if (array_key_exists($keys[5], $arr)) $this->setDbDescription($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbLength($arr[$keys[6]]); if (array_key_exists($keys[6], $arr)) $this->setDbLength($arr[$keys[6]]);
if (array_key_exists($keys[7], $arr)) $this->setDbType($arr[$keys[7]]);
} }
/** /**
@ -1041,7 +990,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
if ($this->isColumnModified(CcPlaylistPeer::CREATOR_ID)) $criteria->add(CcPlaylistPeer::CREATOR_ID, $this->creator_id); if ($this->isColumnModified(CcPlaylistPeer::CREATOR_ID)) $criteria->add(CcPlaylistPeer::CREATOR_ID, $this->creator_id);
if ($this->isColumnModified(CcPlaylistPeer::DESCRIPTION)) $criteria->add(CcPlaylistPeer::DESCRIPTION, $this->description); if ($this->isColumnModified(CcPlaylistPeer::DESCRIPTION)) $criteria->add(CcPlaylistPeer::DESCRIPTION, $this->description);
if ($this->isColumnModified(CcPlaylistPeer::LENGTH)) $criteria->add(CcPlaylistPeer::LENGTH, $this->length); if ($this->isColumnModified(CcPlaylistPeer::LENGTH)) $criteria->add(CcPlaylistPeer::LENGTH, $this->length);
if ($this->isColumnModified(CcPlaylistPeer::TYPE)) $criteria->add(CcPlaylistPeer::TYPE, $this->type);
return $criteria; return $criteria;
} }
@ -1109,7 +1057,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
$copyObj->setDbCreatorId($this->creator_id); $copyObj->setDbCreatorId($this->creator_id);
$copyObj->setDbDescription($this->description); $copyObj->setDbDescription($this->description);
$copyObj->setDbLength($this->length); $copyObj->setDbLength($this->length);
$copyObj->setDbType($this->type);
if ($deepCopy) { if ($deepCopy) {
// important: temporarily setNew(false) because this affects the behavior of // important: temporarily setNew(false) because this affects the behavior of
@ -1387,7 +1334,6 @@ abstract class BaseCcPlaylist extends BaseObject implements Persistent
$this->creator_id = null; $this->creator_id = null;
$this->description = null; $this->description = null;
$this->length = null; $this->length = null;
$this->type = null;
$this->alreadyInSave = false; $this->alreadyInSave = false;
$this->alreadyInValidation = false; $this->alreadyInValidation = false;
$this->clearAllReferences(); $this->clearAllReferences();

View file

@ -26,7 +26,7 @@ abstract class BaseCcPlaylistPeer {
const TM_CLASS = 'CcPlaylistTableMap'; const TM_CLASS = 'CcPlaylistTableMap';
/** The total number of columns. */ /** The total number of columns. */
const NUM_COLUMNS = 8; const NUM_COLUMNS = 7;
/** The number of lazy-loaded columns. */ /** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0; const NUM_LAZY_LOAD_COLUMNS = 0;
@ -52,9 +52,6 @@ abstract class BaseCcPlaylistPeer {
/** the column name for the LENGTH field */ /** the column name for the LENGTH field */
const LENGTH = 'cc_playlist.LENGTH'; const LENGTH = 'cc_playlist.LENGTH';
/** the column name for the TYPE field */
const TYPE = 'cc_playlist.TYPE';
/** /**
* An identiy map to hold any loaded instances of CcPlaylist objects. * An identiy map to hold any loaded instances of CcPlaylist objects.
* This must be public so that other peer classes can access this when hydrating from JOIN * This must be public so that other peer classes can access this when hydrating from JOIN
@ -71,12 +68,12 @@ abstract class BaseCcPlaylistPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/ */
private static $fieldNames = array ( private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMtime', 'DbUtime', 'DbCreatorId', 'DbDescription', 'DbLength', 'DbType', ), BasePeer::TYPE_PHPNAME => array ('DbId', 'DbName', 'DbMtime', 'DbUtime', 'DbCreatorId', 'DbDescription', 'DbLength', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMtime', 'dbUtime', 'dbCreatorId', 'dbDescription', 'dbLength', 'dbType', ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbName', 'dbMtime', 'dbUtime', 'dbCreatorId', 'dbDescription', 'dbLength', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MTIME, self::UTIME, self::CREATOR_ID, self::DESCRIPTION, self::LENGTH, self::TYPE, ), BasePeer::TYPE_COLNAME => array (self::ID, self::NAME, self::MTIME, self::UTIME, self::CREATOR_ID, self::DESCRIPTION, self::LENGTH, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MTIME', 'UTIME', 'CREATOR_ID', 'DESCRIPTION', 'LENGTH', 'TYPE', ), BasePeer::TYPE_RAW_COLNAME => array ('ID', 'NAME', 'MTIME', 'UTIME', 'CREATOR_ID', 'DESCRIPTION', 'LENGTH', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mtime', 'utime', 'creator_id', 'description', 'length', 'type', ), BasePeer::TYPE_FIELDNAME => array ('id', 'name', 'mtime', 'utime', 'creator_id', 'description', 'length', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
); );
/** /**
@ -86,12 +83,12 @@ abstract class BaseCcPlaylistPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0 * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/ */
private static $fieldKeys = array ( private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMtime' => 2, 'DbUtime' => 3, 'DbCreatorId' => 4, 'DbDescription' => 5, 'DbLength' => 6, 'DbType' => 7, ), BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbName' => 1, 'DbMtime' => 2, 'DbUtime' => 3, 'DbCreatorId' => 4, 'DbDescription' => 5, 'DbLength' => 6, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMtime' => 2, 'dbUtime' => 3, 'dbCreatorId' => 4, 'dbDescription' => 5, 'dbLength' => 6, 'dbType' => 7, ), BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbName' => 1, 'dbMtime' => 2, 'dbUtime' => 3, 'dbCreatorId' => 4, 'dbDescription' => 5, 'dbLength' => 6, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MTIME => 2, self::UTIME => 3, self::CREATOR_ID => 4, self::DESCRIPTION => 5, self::LENGTH => 6, self::TYPE => 7, ), BasePeer::TYPE_COLNAME => array (self::ID => 0, self::NAME => 1, self::MTIME => 2, self::UTIME => 3, self::CREATOR_ID => 4, self::DESCRIPTION => 5, self::LENGTH => 6, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MTIME' => 2, 'UTIME' => 3, 'CREATOR_ID' => 4, 'DESCRIPTION' => 5, 'LENGTH' => 6, 'TYPE' => 7, ), BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'NAME' => 1, 'MTIME' => 2, 'UTIME' => 3, 'CREATOR_ID' => 4, 'DESCRIPTION' => 5, 'LENGTH' => 6, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mtime' => 2, 'utime' => 3, 'creator_id' => 4, 'description' => 5, 'length' => 6, 'type' => 7, ), BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'name' => 1, 'mtime' => 2, 'utime' => 3, 'creator_id' => 4, 'description' => 5, 'length' => 6, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, ) BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
); );
/** /**
@ -170,7 +167,6 @@ abstract class BaseCcPlaylistPeer {
$criteria->addSelectColumn(CcPlaylistPeer::CREATOR_ID); $criteria->addSelectColumn(CcPlaylistPeer::CREATOR_ID);
$criteria->addSelectColumn(CcPlaylistPeer::DESCRIPTION); $criteria->addSelectColumn(CcPlaylistPeer::DESCRIPTION);
$criteria->addSelectColumn(CcPlaylistPeer::LENGTH); $criteria->addSelectColumn(CcPlaylistPeer::LENGTH);
$criteria->addSelectColumn(CcPlaylistPeer::TYPE);
} else { } else {
$criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.NAME'); $criteria->addSelectColumn($alias . '.NAME');
@ -179,7 +175,6 @@ abstract class BaseCcPlaylistPeer {
$criteria->addSelectColumn($alias . '.CREATOR_ID'); $criteria->addSelectColumn($alias . '.CREATOR_ID');
$criteria->addSelectColumn($alias . '.DESCRIPTION'); $criteria->addSelectColumn($alias . '.DESCRIPTION');
$criteria->addSelectColumn($alias . '.LENGTH'); $criteria->addSelectColumn($alias . '.LENGTH');
$criteria->addSelectColumn($alias . '.TYPE');
} }
} }

View file

@ -13,7 +13,6 @@
* @method CcPlaylistQuery orderByDbCreatorId($order = Criteria::ASC) Order by the creator_id column * @method CcPlaylistQuery orderByDbCreatorId($order = Criteria::ASC) Order by the creator_id column
* @method CcPlaylistQuery orderByDbDescription($order = Criteria::ASC) Order by the description column * @method CcPlaylistQuery orderByDbDescription($order = Criteria::ASC) Order by the description column
* @method CcPlaylistQuery orderByDbLength($order = Criteria::ASC) Order by the length column * @method CcPlaylistQuery orderByDbLength($order = Criteria::ASC) Order by the length column
* @method CcPlaylistQuery orderByDbType($order = Criteria::ASC) Order by the type column
* *
* @method CcPlaylistQuery groupByDbId() Group by the id column * @method CcPlaylistQuery groupByDbId() Group by the id column
* @method CcPlaylistQuery groupByDbName() Group by the name column * @method CcPlaylistQuery groupByDbName() Group by the name column
@ -22,7 +21,6 @@
* @method CcPlaylistQuery groupByDbCreatorId() Group by the creator_id column * @method CcPlaylistQuery groupByDbCreatorId() Group by the creator_id column
* @method CcPlaylistQuery groupByDbDescription() Group by the description column * @method CcPlaylistQuery groupByDbDescription() Group by the description column
* @method CcPlaylistQuery groupByDbLength() Group by the length column * @method CcPlaylistQuery groupByDbLength() Group by the length column
* @method CcPlaylistQuery groupByDbType() Group by the type column
* *
* @method CcPlaylistQuery leftJoin($relation) Adds a LEFT JOIN clause to the query * @method CcPlaylistQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
* @method CcPlaylistQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query * @method CcPlaylistQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
@ -46,7 +44,6 @@
* @method CcPlaylist findOneByDbCreatorId(int $creator_id) Return the first CcPlaylist filtered by the creator_id column * @method CcPlaylist findOneByDbCreatorId(int $creator_id) Return the first CcPlaylist filtered by the creator_id column
* @method CcPlaylist findOneByDbDescription(string $description) Return the first CcPlaylist filtered by the description column * @method CcPlaylist findOneByDbDescription(string $description) Return the first CcPlaylist filtered by the description column
* @method CcPlaylist findOneByDbLength(string $length) Return the first CcPlaylist filtered by the length column * @method CcPlaylist findOneByDbLength(string $length) Return the first CcPlaylist filtered by the length column
* @method CcPlaylist findOneByDbType(string $type) Return the first CcPlaylist filtered by the type column
* *
* @method array findByDbId(int $id) Return CcPlaylist objects filtered by the id column * @method array findByDbId(int $id) Return CcPlaylist objects filtered by the id column
* @method array findByDbName(string $name) Return CcPlaylist objects filtered by the name column * @method array findByDbName(string $name) Return CcPlaylist objects filtered by the name column
@ -55,7 +52,6 @@
* @method array findByDbCreatorId(int $creator_id) Return CcPlaylist objects filtered by the creator_id column * @method array findByDbCreatorId(int $creator_id) Return CcPlaylist objects filtered by the creator_id column
* @method array findByDbDescription(string $description) Return CcPlaylist objects filtered by the description column * @method array findByDbDescription(string $description) Return CcPlaylist objects filtered by the description column
* @method array findByDbLength(string $length) Return CcPlaylist objects filtered by the length column * @method array findByDbLength(string $length) Return CcPlaylist objects filtered by the length column
* @method array findByDbType(string $type) Return CcPlaylist objects filtered by the type column
* *
* @package propel.generator.airtime.om * @package propel.generator.airtime.om
*/ */
@ -341,28 +337,6 @@ abstract class BaseCcPlaylistQuery extends ModelCriteria
return $this->addUsingAlias(CcPlaylistPeer::LENGTH, $dbLength, $comparison); return $this->addUsingAlias(CcPlaylistPeer::LENGTH, $dbLength, $comparison);
} }
/**
* Filter the query on the type column
*
* @param string $dbType The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlaylistQuery The current query, for fluid interface
*/
public function filterByDbType($dbType = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbType)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbType)) {
$dbType = str_replace('*', '%', $dbType);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPlaylistPeer::TYPE, $dbType, $comparison);
}
/** /**
* Filter the query by a related CcSubjs object * Filter the query by a related CcSubjs object
* *

View file

@ -201,7 +201,6 @@
<column name="creator_id" phpName="DbCreatorId" type="INTEGER" required="false"/> <column name="creator_id" phpName="DbCreatorId" type="INTEGER" required="false"/>
<column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/> <column name="description" phpName="DbDescription" type="VARCHAR" size="512" required="false"/>
<column name="length" phpName="DbLength" type="VARCHAR" sqlType="interval" defaultValue="00:00:00"/> <column name="length" phpName="DbLength" type="VARCHAR" sqlType="interval" defaultValue="00:00:00"/>
<column name="type" phpName="DbType" type="VARCHAR" size="7" defaultValue="static"/>
<behavior name="aggregate_column"> <behavior name="aggregate_column">
<parameter name="name" value="length" /> <parameter name="name" value="length" />
<parameter name="foreign_table" value="cc_playlistcontents" /> <parameter name="foreign_table" value="cc_playlistcontents" />

View file

@ -269,7 +269,6 @@ CREATE TABLE "cc_playlist"
"creator_id" INTEGER, "creator_id" INTEGER,
"description" VARCHAR(512), "description" VARCHAR(512),
"length" interval default '00:00:00', "length" interval default '00:00:00',
"type" VARCHAR(7) default 'static',
PRIMARY KEY ("id") PRIMARY KEY ("id")
); );