GI-212 Quitar llave primaria de la tabla de colas de relabeling
This commit is contained in:
@@ -292,6 +292,7 @@ class labelsGmail
|
|||||||
public function addRelabelingToQueue($caseId, $index, $actualLastIndex, $unassigned=false)
|
public function addRelabelingToQueue($caseId, $index, $actualLastIndex, $unassigned=false)
|
||||||
{
|
{
|
||||||
$labelingQueue = new GmailRelabeling();
|
$labelingQueue = new GmailRelabeling();
|
||||||
|
$labelingQueue->setCreateDate(date('Y-m-d H:i:s'));
|
||||||
$labelingQueue->setAppUid($caseId);
|
$labelingQueue->setAppUid($caseId);
|
||||||
$labelingQueue->setDelIndex($index);
|
$labelingQueue->setDelIndex($index);
|
||||||
$labelingQueue->setCurrentLastIndex($actualLastIndex);
|
$labelingQueue->setCurrentLastIndex($actualLastIndex);
|
||||||
|
|||||||
@@ -65,9 +65,11 @@ class GmailRelabelingMapBuilder
|
|||||||
|
|
||||||
$tMap->setUseIdGenerator(false);
|
$tMap->setUseIdGenerator(false);
|
||||||
|
|
||||||
$tMap->addPrimaryKey('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
$tMap->addColumn('CREATE_DATE', 'CreateDate', 'int', CreoleTypes::TIMESTAMP, false, null);
|
||||||
|
|
||||||
$tMap->addPrimaryKey('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
$tMap->addColumn('APP_UID', 'AppUid', 'string', CreoleTypes::VARCHAR, true, 32);
|
||||||
|
|
||||||
|
$tMap->addColumn('DEL_INDEX', 'DelIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||||
|
|
||||||
$tMap->addColumn('CURRENT_LAST_INDEX', 'CurrentLastIndex', 'int', CreoleTypes::INTEGER, true, null);
|
$tMap->addColumn('CURRENT_LAST_INDEX', 'CurrentLastIndex', 'int', CreoleTypes::INTEGER, true, null);
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,12 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected static $peer;
|
protected static $peer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The value for the create_date field.
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $create_date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The value for the app_uid field.
|
* The value for the app_uid field.
|
||||||
* @var string
|
* @var string
|
||||||
@@ -77,6 +83,38 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
*/
|
*/
|
||||||
protected $alreadyInValidation = false;
|
protected $alreadyInValidation = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the [optionally formatted] [create_date] column value.
|
||||||
|
*
|
||||||
|
* @param string $format The date/time format string (either date()-style or strftime()-style).
|
||||||
|
* If format is NULL, then the integer unix timestamp will be returned.
|
||||||
|
* @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
|
||||||
|
* @throws PropelException - if unable to convert the date/time to timestamp.
|
||||||
|
*/
|
||||||
|
public function getCreateDate($format = 'Y-m-d H:i:s')
|
||||||
|
{
|
||||||
|
|
||||||
|
if ($this->create_date === null || $this->create_date === '') {
|
||||||
|
return null;
|
||||||
|
} elseif (!is_int($this->create_date)) {
|
||||||
|
// a non-timestamp value was set externally, so we convert it
|
||||||
|
$ts = strtotime($this->create_date);
|
||||||
|
if ($ts === -1 || $ts === false) {
|
||||||
|
throw new PropelException("Unable to parse value of [create_date] as date/time value: " .
|
||||||
|
var_export($this->create_date, true));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$ts = $this->create_date;
|
||||||
|
}
|
||||||
|
if ($format === null) {
|
||||||
|
return $ts;
|
||||||
|
} elseif (strpos($format, '%') !== false) {
|
||||||
|
return strftime($format, $ts);
|
||||||
|
} else {
|
||||||
|
return date($format, $ts);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the [app_uid] column value.
|
* Get the [app_uid] column value.
|
||||||
*
|
*
|
||||||
@@ -143,6 +181,35 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
return $this->msg_error;
|
return $this->msg_error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the value of [create_date] column.
|
||||||
|
*
|
||||||
|
* @param int $v new value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setCreateDate($v)
|
||||||
|
{
|
||||||
|
|
||||||
|
if ($v !== null && !is_int($v)) {
|
||||||
|
$ts = strtotime($v);
|
||||||
|
//Date/time accepts null values
|
||||||
|
if ($v == '') {
|
||||||
|
$ts = null;
|
||||||
|
}
|
||||||
|
if ($ts === -1 || $ts === false) {
|
||||||
|
throw new PropelException("Unable to parse date/time value for [create_date] from input: " .
|
||||||
|
var_export($v, true));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$ts = $v;
|
||||||
|
}
|
||||||
|
if ($this->create_date !== $ts) {
|
||||||
|
$this->create_date = $ts;
|
||||||
|
$this->modifiedColumns[] = GmailRelabelingPeer::CREATE_DATE;
|
||||||
|
}
|
||||||
|
|
||||||
|
} // setCreateDate()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the value of [app_uid] column.
|
* Set the value of [app_uid] column.
|
||||||
*
|
*
|
||||||
@@ -292,24 +359,26 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$this->app_uid = $rs->getString($startcol + 0);
|
$this->create_date = $rs->getTimestamp($startcol + 0, null);
|
||||||
|
|
||||||
$this->del_index = $rs->getInt($startcol + 1);
|
$this->app_uid = $rs->getString($startcol + 1);
|
||||||
|
|
||||||
$this->current_last_index = $rs->getInt($startcol + 2);
|
$this->del_index = $rs->getInt($startcol + 2);
|
||||||
|
|
||||||
$this->unassigned = $rs->getInt($startcol + 3);
|
$this->current_last_index = $rs->getInt($startcol + 3);
|
||||||
|
|
||||||
$this->status = $rs->getString($startcol + 4);
|
$this->unassigned = $rs->getInt($startcol + 4);
|
||||||
|
|
||||||
$this->msg_error = $rs->getString($startcol + 5);
|
$this->status = $rs->getString($startcol + 5);
|
||||||
|
|
||||||
|
$this->msg_error = $rs->getString($startcol + 6);
|
||||||
|
|
||||||
$this->resetModified();
|
$this->resetModified();
|
||||||
|
|
||||||
$this->setNew(false);
|
$this->setNew(false);
|
||||||
|
|
||||||
// FIXME - using NUM_COLUMNS may be clearer.
|
// FIXME - using NUM_COLUMNS may be clearer.
|
||||||
return $startcol + 6; // 6 = GmailRelabelingPeer::NUM_COLUMNS - GmailRelabelingPeer::NUM_LAZY_LOAD_COLUMNS).
|
return $startcol + 7; // 7 = GmailRelabelingPeer::NUM_COLUMNS - GmailRelabelingPeer::NUM_LAZY_LOAD_COLUMNS).
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
throw new PropelException("Error populating GmailRelabeling object", $e);
|
throw new PropelException("Error populating GmailRelabeling object", $e);
|
||||||
@@ -514,21 +583,24 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
switch($pos) {
|
switch($pos) {
|
||||||
case 0:
|
case 0:
|
||||||
return $this->getAppUid();
|
return $this->getCreateDate();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
return $this->getDelIndex();
|
return $this->getAppUid();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
return $this->getCurrentLastIndex();
|
return $this->getDelIndex();
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
return $this->getUnassigned();
|
return $this->getCurrentLastIndex();
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
return $this->getStatus();
|
return $this->getUnassigned();
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
return $this->getStatus();
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
return $this->getMsgError();
|
return $this->getMsgError();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -551,12 +623,13 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
$keys = GmailRelabelingPeer::getFieldNames($keyType);
|
$keys = GmailRelabelingPeer::getFieldNames($keyType);
|
||||||
$result = array(
|
$result = array(
|
||||||
$keys[0] => $this->getAppUid(),
|
$keys[0] => $this->getCreateDate(),
|
||||||
$keys[1] => $this->getDelIndex(),
|
$keys[1] => $this->getAppUid(),
|
||||||
$keys[2] => $this->getCurrentLastIndex(),
|
$keys[2] => $this->getDelIndex(),
|
||||||
$keys[3] => $this->getUnassigned(),
|
$keys[3] => $this->getCurrentLastIndex(),
|
||||||
$keys[4] => $this->getStatus(),
|
$keys[4] => $this->getUnassigned(),
|
||||||
$keys[5] => $this->getMsgError(),
|
$keys[5] => $this->getStatus(),
|
||||||
|
$keys[6] => $this->getMsgError(),
|
||||||
);
|
);
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
@@ -589,21 +662,24 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
switch($pos) {
|
switch($pos) {
|
||||||
case 0:
|
case 0:
|
||||||
$this->setAppUid($value);
|
$this->setCreateDate($value);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
$this->setDelIndex($value);
|
$this->setAppUid($value);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
$this->setCurrentLastIndex($value);
|
$this->setDelIndex($value);
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
$this->setUnassigned($value);
|
$this->setCurrentLastIndex($value);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
$this->setStatus($value);
|
$this->setUnassigned($value);
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
|
$this->setStatus($value);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
$this->setMsgError($value);
|
$this->setMsgError($value);
|
||||||
break;
|
break;
|
||||||
} // switch()
|
} // switch()
|
||||||
@@ -630,27 +706,31 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
$keys = GmailRelabelingPeer::getFieldNames($keyType);
|
$keys = GmailRelabelingPeer::getFieldNames($keyType);
|
||||||
|
|
||||||
if (array_key_exists($keys[0], $arr)) {
|
if (array_key_exists($keys[0], $arr)) {
|
||||||
$this->setAppUid($arr[$keys[0]]);
|
$this->setCreateDate($arr[$keys[0]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[1], $arr)) {
|
if (array_key_exists($keys[1], $arr)) {
|
||||||
$this->setDelIndex($arr[$keys[1]]);
|
$this->setAppUid($arr[$keys[1]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[2], $arr)) {
|
if (array_key_exists($keys[2], $arr)) {
|
||||||
$this->setCurrentLastIndex($arr[$keys[2]]);
|
$this->setDelIndex($arr[$keys[2]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[3], $arr)) {
|
if (array_key_exists($keys[3], $arr)) {
|
||||||
$this->setUnassigned($arr[$keys[3]]);
|
$this->setCurrentLastIndex($arr[$keys[3]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[4], $arr)) {
|
if (array_key_exists($keys[4], $arr)) {
|
||||||
$this->setStatus($arr[$keys[4]]);
|
$this->setUnassigned($arr[$keys[4]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (array_key_exists($keys[5], $arr)) {
|
if (array_key_exists($keys[5], $arr)) {
|
||||||
$this->setMsgError($arr[$keys[5]]);
|
$this->setStatus($arr[$keys[5]]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (array_key_exists($keys[6], $arr)) {
|
||||||
|
$this->setMsgError($arr[$keys[6]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -664,6 +744,10 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
$criteria = new Criteria(GmailRelabelingPeer::DATABASE_NAME);
|
$criteria = new Criteria(GmailRelabelingPeer::DATABASE_NAME);
|
||||||
|
|
||||||
|
if ($this->isColumnModified(GmailRelabelingPeer::CREATE_DATE)) {
|
||||||
|
$criteria->add(GmailRelabelingPeer::CREATE_DATE, $this->create_date);
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isColumnModified(GmailRelabelingPeer::APP_UID)) {
|
if ($this->isColumnModified(GmailRelabelingPeer::APP_UID)) {
|
||||||
$criteria->add(GmailRelabelingPeer::APP_UID, $this->app_uid);
|
$criteria->add(GmailRelabelingPeer::APP_UID, $this->app_uid);
|
||||||
}
|
}
|
||||||
@@ -704,42 +788,33 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
{
|
{
|
||||||
$criteria = new Criteria(GmailRelabelingPeer::DATABASE_NAME);
|
$criteria = new Criteria(GmailRelabelingPeer::DATABASE_NAME);
|
||||||
|
|
||||||
$criteria->add(GmailRelabelingPeer::APP_UID, $this->app_uid);
|
|
||||||
$criteria->add(GmailRelabelingPeer::DEL_INDEX, $this->del_index);
|
|
||||||
|
|
||||||
return $criteria;
|
return $criteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the composite primary key for this object.
|
* Returns NULL since this table doesn't have a primary key.
|
||||||
* The array elements will be in same order as specified in XML.
|
* This method exists only for BC and is deprecated!
|
||||||
* @return array
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function getPrimaryKey()
|
public function getPrimaryKey()
|
||||||
{
|
{
|
||||||
$pks = array();
|
return null;
|
||||||
|
|
||||||
$pks[0] = $this->getAppUid();
|
|
||||||
|
|
||||||
$pks[1] = $this->getDelIndex();
|
|
||||||
|
|
||||||
return $pks;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the [composite] primary key.
|
* Dummy primary key setter.
|
||||||
*
|
*
|
||||||
* @param array $keys The elements of the composite key (order must match the order in XML file).
|
* This function only exists to preserve backwards compatibility. It is no longer
|
||||||
* @return void
|
* needed or required by the Persistent interface. It will be removed in next BC-breaking
|
||||||
|
* release of Propel.
|
||||||
|
*
|
||||||
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public function setPrimaryKey($keys)
|
public function setPrimaryKey($pk)
|
||||||
{
|
{
|
||||||
|
// do nothing, because this object doesn't have any primary keys
|
||||||
$this->setAppUid($keys[0]);
|
}
|
||||||
|
|
||||||
$this->setDelIndex($keys[1]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets contents of passed object to values from current object.
|
* Sets contents of passed object to values from current object.
|
||||||
@@ -754,6 +829,12 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
public function copyInto($copyObj, $deepCopy = false)
|
public function copyInto($copyObj, $deepCopy = false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$copyObj->setCreateDate($this->create_date);
|
||||||
|
|
||||||
|
$copyObj->setAppUid($this->app_uid);
|
||||||
|
|
||||||
|
$copyObj->setDelIndex($this->del_index);
|
||||||
|
|
||||||
$copyObj->setCurrentLastIndex($this->current_last_index);
|
$copyObj->setCurrentLastIndex($this->current_last_index);
|
||||||
|
|
||||||
$copyObj->setUnassigned($this->unassigned);
|
$copyObj->setUnassigned($this->unassigned);
|
||||||
@@ -765,10 +846,6 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent
|
|||||||
|
|
||||||
$copyObj->setNew(true);
|
$copyObj->setNew(true);
|
||||||
|
|
||||||
$copyObj->setAppUid(''); // this is a pkey column, so set to default value
|
|
||||||
|
|
||||||
$copyObj->setDelIndex('0'); // this is a pkey column, so set to default value
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,12 +25,15 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
const CLASS_DEFAULT = 'classes.model.GmailRelabeling';
|
const CLASS_DEFAULT = 'classes.model.GmailRelabeling';
|
||||||
|
|
||||||
/** The total number of columns. */
|
/** The total number of columns. */
|
||||||
const NUM_COLUMNS = 6;
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/** the column name for the CREATE_DATE field */
|
||||||
|
const CREATE_DATE = 'GMAIL_RELABELING.CREATE_DATE';
|
||||||
|
|
||||||
/** the column name for the APP_UID field */
|
/** the column name for the APP_UID field */
|
||||||
const APP_UID = 'GMAIL_RELABELING.APP_UID';
|
const APP_UID = 'GMAIL_RELABELING.APP_UID';
|
||||||
|
|
||||||
@@ -60,10 +63,10 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
* 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 ('AppUid', 'DelIndex', 'CurrentLastIndex', 'Unassigned', 'Status', 'MsgError', ),
|
BasePeer::TYPE_PHPNAME => array ('CreateDate', 'AppUid', 'DelIndex', 'CurrentLastIndex', 'Unassigned', 'Status', 'MsgError', ),
|
||||||
BasePeer::TYPE_COLNAME => array (GmailRelabelingPeer::APP_UID, GmailRelabelingPeer::DEL_INDEX, GmailRelabelingPeer::CURRENT_LAST_INDEX, GmailRelabelingPeer::UNASSIGNED, GmailRelabelingPeer::STATUS, GmailRelabelingPeer::MSG_ERROR, ),
|
BasePeer::TYPE_COLNAME => array (GmailRelabelingPeer::CREATE_DATE, GmailRelabelingPeer::APP_UID, GmailRelabelingPeer::DEL_INDEX, GmailRelabelingPeer::CURRENT_LAST_INDEX, GmailRelabelingPeer::UNASSIGNED, GmailRelabelingPeer::STATUS, GmailRelabelingPeer::MSG_ERROR, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID', 'DEL_INDEX', 'CURRENT_LAST_INDEX', 'UNASSIGNED', 'STATUS', 'MSG_ERROR', ),
|
BasePeer::TYPE_FIELDNAME => array ('CREATE_DATE', 'APP_UID', 'DEL_INDEX', 'CURRENT_LAST_INDEX', 'UNASSIGNED', 'STATUS', 'MSG_ERROR', ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -73,10 +76,10 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
* 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 ('AppUid' => 0, 'DelIndex' => 1, 'CurrentLastIndex' => 2, 'Unassigned' => 3, 'Status' => 4, 'MsgError' => 5, ),
|
BasePeer::TYPE_PHPNAME => array ('CreateDate' => 0, 'AppUid' => 1, 'DelIndex' => 2, 'CurrentLastIndex' => 3, 'Unassigned' => 4, 'Status' => 5, 'MsgError' => 6, ),
|
||||||
BasePeer::TYPE_COLNAME => array (GmailRelabelingPeer::APP_UID => 0, GmailRelabelingPeer::DEL_INDEX => 1, GmailRelabelingPeer::CURRENT_LAST_INDEX => 2, GmailRelabelingPeer::UNASSIGNED => 3, GmailRelabelingPeer::STATUS => 4, GmailRelabelingPeer::MSG_ERROR => 5, ),
|
BasePeer::TYPE_COLNAME => array (GmailRelabelingPeer::CREATE_DATE => 0, GmailRelabelingPeer::APP_UID => 1, GmailRelabelingPeer::DEL_INDEX => 2, GmailRelabelingPeer::CURRENT_LAST_INDEX => 3, GmailRelabelingPeer::UNASSIGNED => 4, GmailRelabelingPeer::STATUS => 5, GmailRelabelingPeer::MSG_ERROR => 6, ),
|
||||||
BasePeer::TYPE_FIELDNAME => array ('APP_UID' => 0, 'DEL_INDEX' => 1, 'CURRENT_LAST_INDEX' => 2, 'UNASSIGNED' => 3, 'STATUS' => 4, 'MSG_ERROR' => 5, ),
|
BasePeer::TYPE_FIELDNAME => array ('CREATE_DATE' => 0, 'APP_UID' => 1, 'DEL_INDEX' => 2, 'CURRENT_LAST_INDEX' => 3, 'UNASSIGNED' => 4, 'STATUS' => 5, 'MSG_ERROR' => 6, ),
|
||||||
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
|
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
|
||||||
);
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -177,6 +180,8 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
public static function addSelectColumns(Criteria $criteria)
|
public static function addSelectColumns(Criteria $criteria)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$criteria->addSelectColumn(GmailRelabelingPeer::CREATE_DATE);
|
||||||
|
|
||||||
$criteria->addSelectColumn(GmailRelabelingPeer::APP_UID);
|
$criteria->addSelectColumn(GmailRelabelingPeer::APP_UID);
|
||||||
|
|
||||||
$criteria->addSelectColumn(GmailRelabelingPeer::DEL_INDEX);
|
$criteria->addSelectColumn(GmailRelabelingPeer::DEL_INDEX);
|
||||||
@@ -191,8 +196,8 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const COUNT = 'COUNT(GMAIL_RELABELING.APP_UID)';
|
const COUNT = 'COUNT(*)';
|
||||||
const COUNT_DISTINCT = 'COUNT(DISTINCT GMAIL_RELABELING.APP_UID)';
|
const COUNT_DISTINCT = 'COUNT(DISTINCT *)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the number of rows matching criteria.
|
* Returns the number of rows matching criteria.
|
||||||
@@ -401,12 +406,6 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
if ($values instanceof Criteria) {
|
if ($values instanceof Criteria) {
|
||||||
$criteria = clone $values; // rename for clarity
|
$criteria = clone $values; // rename for clarity
|
||||||
|
|
||||||
$comparison = $criteria->getComparison(GmailRelabelingPeer::APP_UID);
|
|
||||||
$selectCriteria->add(GmailRelabelingPeer::APP_UID, $criteria->remove(GmailRelabelingPeer::APP_UID), $comparison);
|
|
||||||
|
|
||||||
$comparison = $criteria->getComparison(GmailRelabelingPeer::DEL_INDEX);
|
|
||||||
$selectCriteria->add(GmailRelabelingPeer::DEL_INDEX, $criteria->remove(GmailRelabelingPeer::DEL_INDEX), $comparison);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$criteria = $values->buildCriteria(); // gets full criteria
|
$criteria = $values->buildCriteria(); // gets full criteria
|
||||||
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
$selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
|
||||||
@@ -464,7 +463,7 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
$criteria = clone $values; // rename for clarity
|
$criteria = clone $values; // rename for clarity
|
||||||
} elseif ($values instanceof GmailRelabeling) {
|
} elseif ($values instanceof GmailRelabeling) {
|
||||||
|
|
||||||
$criteria = $values->buildPkeyCriteria();
|
$criteria = $values->buildCriteria();
|
||||||
} else {
|
} else {
|
||||||
// it must be the primary key
|
// it must be the primary key
|
||||||
$criteria = new Criteria(self::DATABASE_NAME);
|
$criteria = new Criteria(self::DATABASE_NAME);
|
||||||
@@ -478,12 +477,8 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
$vals = array();
|
$vals = array();
|
||||||
foreach ($values as $value) {
|
foreach ($values as $value) {
|
||||||
|
|
||||||
$vals[0][] = $value[0];
|
|
||||||
$vals[1][] = $value[1];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$criteria->add(GmailRelabelingPeer::APP_UID, $vals[0], Criteria::IN);
|
|
||||||
$criteria->add(GmailRelabelingPeer::DEL_INDEX, $vals[1], Criteria::IN);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the correct dbName
|
// Set the correct dbName
|
||||||
@@ -541,26 +536,6 @@ abstract class BaseGmailRelabelingPeer
|
|||||||
|
|
||||||
return BasePeer::doValidate(GmailRelabelingPeer::DATABASE_NAME, GmailRelabelingPeer::TABLE_NAME, $columns);
|
return BasePeer::doValidate(GmailRelabelingPeer::DATABASE_NAME, GmailRelabelingPeer::TABLE_NAME, $columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve object using using composite pkey values.
|
|
||||||
* @param string $app_uid
|
|
||||||
* @param int $del_index
|
|
||||||
* @param Connection $con
|
|
||||||
* @return GmailRelabeling
|
|
||||||
*/
|
|
||||||
public static function retrieveByPK($app_uid, $del_index, $con = null)
|
|
||||||
{
|
|
||||||
if ($con === null) {
|
|
||||||
$con = Propel::getConnection(self::DATABASE_NAME);
|
|
||||||
}
|
|
||||||
$criteria = new Criteria();
|
|
||||||
$criteria->add(GmailRelabelingPeer::APP_UID, $app_uid);
|
|
||||||
$criteria->add(GmailRelabelingPeer::DEL_INDEX, $del_index);
|
|
||||||
$v = GmailRelabelingPeer::doSelect($criteria, $con);
|
|
||||||
|
|
||||||
return !empty($v) ? $v[0] : null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5261,8 +5261,9 @@
|
|||||||
<parameter name="Create_options" value="" />
|
<parameter name="Create_options" value="" />
|
||||||
<parameter name="Comment" value="Task for label relabaling"/>
|
<parameter name="Comment" value="Task for label relabaling"/>
|
||||||
</vendor>
|
</vendor>
|
||||||
<column name="APP_UID" type="VARCHAR" size="32" required="true" primaryKey="true" default=""/>
|
<column name="CREATE_DATE" type="TIMESTAMP" required="false"/>
|
||||||
<column name="DEL_INDEX" type="INTEGER" required="true" primaryKey="true" default="0"/>
|
<column name="APP_UID" type="VARCHAR" size="32" required="true" default=""/>
|
||||||
|
<column name="DEL_INDEX" type="INTEGER" required="true" default="0"/>
|
||||||
<column name="CURRENT_LAST_INDEX" type="INTEGER" required="true" default="0"/>
|
<column name="CURRENT_LAST_INDEX" type="INTEGER" required="true" default="0"/>
|
||||||
<column name="UNASSIGNED" type="INTEGER" required="true" default="0"/>
|
<column name="UNASSIGNED" type="INTEGER" required="true" default="0"/>
|
||||||
<column name="STATUS" type="VARCHAR" size="32" required="true" default="pending"/>
|
<column name="STATUS" type="VARCHAR" size="32" required="true" default="pending"/>
|
||||||
|
|||||||
@@ -2938,13 +2938,13 @@ CREATE TABLE `NOTIFICATION_DEVICE`
|
|||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|
||||||
CREATE TABLE `GMAIL_RELABELING` (
|
CREATE TABLE `GMAIL_RELABELING` (
|
||||||
|
`CREATE_DATE` DATETIME NOT NULL DEFAULT '',
|
||||||
`APP_UID` VARCHAR(32) NOT NULL DEFAULT '',
|
`APP_UID` VARCHAR(32) NOT NULL DEFAULT '',
|
||||||
`DEL_INDEX` INT(11) NOT NULL DEFAULT '0',
|
`DEL_INDEX` INT(11) NOT NULL DEFAULT '0',
|
||||||
`CURRENT_LAST_INDEX` INT(11) NOT NULL DEFAULT '0',
|
`CURRENT_LAST_INDEX` INT(11) NOT NULL DEFAULT '0',
|
||||||
`UNASSIGNED` INT(11) NOT NULL DEFAULT '0',
|
`UNASSIGNED` INT(11) NOT NULL DEFAULT '0',
|
||||||
`STATUS` VARCHAR(32) NOT NULL DEFAULT 'pending',
|
`STATUS` VARCHAR(32) NOT NULL DEFAULT 'pending',
|
||||||
`MSG_ERROR` TEXT NULL,
|
`MSG_ERROR` TEXT NULL,
|
||||||
PRIMARY KEY (`APP_UID`, `DEL_INDEX`),
|
|
||||||
KEY `indexStatus` (`STATUS`)
|
KEY `indexStatus` (`STATUS`)
|
||||||
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Task to synchronize Gmail Labels';
|
)ENGINE=InnoDB DEFAULT CHARSET='utf8' COMMENT='Task to synchronize Gmail Labels';
|
||||||
# This restores the fkey checks, after having unset them earlier
|
# This restores the fkey checks, after having unset them earlier
|
||||||
|
|||||||
Reference in New Issue
Block a user