diff --git a/workflow/engine/classes/class.labelsGmail.php b/workflow/engine/classes/class.labelsGmail.php index 973fc1956..75eb9cfff 100644 --- a/workflow/engine/classes/class.labelsGmail.php +++ b/workflow/engine/classes/class.labelsGmail.php @@ -342,6 +342,7 @@ class labelsGmail { $labelingQueue = new GmailRelabeling(); $labelingQueue->setCreateDate(date('Y-m-d H:i:s')); + $labelingQueue->setLabelingUid(G::generateUniqueID()); $labelingQueue->setAppUid($caseId); $labelingQueue->setDelIndex($index); $labelingQueue->setCurrentLastIndex($actualLastIndex); @@ -354,7 +355,7 @@ class labelsGmail { $c = new \Criteria( 'workflow' ); $c->add( \GmailRelabelingPeer::STATUS, 'pending' ); - $c->addAscendingOrderByColumn('LABELING_UID'); + $c->addAscendingOrderByColumn('CREATE_DATE'); $list = \GmailRelabelingPeer::doSelect($c); foreach($list as $task) { try { diff --git a/workflow/engine/classes/model/map/GmailRelabelingMapBuilder.php b/workflow/engine/classes/model/map/GmailRelabelingMapBuilder.php index 0c49a665c..02a53d1bb 100644 --- a/workflow/engine/classes/model/map/GmailRelabelingMapBuilder.php +++ b/workflow/engine/classes/model/map/GmailRelabelingMapBuilder.php @@ -65,7 +65,7 @@ class GmailRelabelingMapBuilder $tMap->setUseIdGenerator(false); - $tMap->addPrimaryKey('LABELING_UID', 'LabelingUid', 'int', CreoleTypes::INTEGER, true, null); + $tMap->addPrimaryKey('LABELING_UID', 'LabelingUid', 'string', CreoleTypes::VARCHAR, true, 32); $tMap->addColumn('CREATE_DATE', 'CreateDate', 'int', CreoleTypes::TIMESTAMP, true, null); diff --git a/workflow/engine/classes/model/om/BaseGmailRelabeling.php b/workflow/engine/classes/model/om/BaseGmailRelabeling.php index 22ff50b98..9a5bd34e2 100644 --- a/workflow/engine/classes/model/om/BaseGmailRelabeling.php +++ b/workflow/engine/classes/model/om/BaseGmailRelabeling.php @@ -29,7 +29,7 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent /** * The value for the labeling_uid field. - * @var int + * @var string */ protected $labeling_uid; @@ -92,7 +92,7 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent /** * Get the [labeling_uid] column value. * - * @return int + * @return string */ public function getLabelingUid() { @@ -201,16 +201,16 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent /** * Set the value of [labeling_uid] column. * - * @param int $v new value + * @param string $v new value * @return void */ public function setLabelingUid($v) { - // Since the native PHP type for this column is integer, - // we will cast the input value to an int (if it is not). - if ($v !== null && !is_int($v) && is_numeric($v)) { - $v = (int) $v; + // Since the native PHP type for this column is string, + // we will cast the input to a string (if it is not). + if ($v !== null && !is_string($v)) { + $v = (string) $v; } if ($this->labeling_uid !== $v) { @@ -398,7 +398,7 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent { try { - $this->labeling_uid = $rs->getInt($startcol + 0); + $this->labeling_uid = $rs->getString($startcol + 0); $this->create_date = $rs->getTimestamp($startcol + 1, null); @@ -851,7 +851,7 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent /** * Returns the primary key for this object (row). - * @return int + * @return string */ public function getPrimaryKey() { @@ -861,7 +861,7 @@ abstract class BaseGmailRelabeling extends BaseObject implements Persistent /** * Generic method to set the primary key (labeling_uid column). * - * @param int $key Primary key. + * @param string $key Primary key. * @return void */ public function setPrimaryKey($key) diff --git a/workflow/engine/config/schema.xml b/workflow/engine/config/schema.xml index ec3cb1160..9e02da358 100755 --- a/workflow/engine/config/schema.xml +++ b/workflow/engine/config/schema.xml @@ -5261,7 +5261,7 @@ - + diff --git a/workflow/engine/data/mysql/schema.sql b/workflow/engine/data/mysql/schema.sql index bdc4a09f3..0bad49b61 100755 --- a/workflow/engine/data/mysql/schema.sql +++ b/workflow/engine/data/mysql/schema.sql @@ -2938,7 +2938,7 @@ CREATE TABLE `NOTIFICATION_DEVICE` #----------------------------------------------------------------------------- CREATE TABLE `GMAIL_RELABELING` ( - `LABELING_ID` INTEGER NOT NULL AUTO_INCREMENT, + `LABELING_ID` INTEGER NOT NULL AUTO_INCREMENT, `CREATE_DATE` DATETIME NOT NULL DEFAULT '', `APP_UID` VARCHAR(32) NOT NULL DEFAULT '', `DEL_INDEX` INT(11) NOT NULL DEFAULT '0',