diff --git a/core/lib/Thelia/Model/Base/Export.php b/core/lib/Thelia/Model/Base/Export.php index 304bccdcd..904a8597b 100644 --- a/core/lib/Thelia/Model/Base/Export.php +++ b/core/lib/Thelia/Model/Base/Export.php @@ -71,18 +71,18 @@ abstract class Export implements ActiveRecordInterface */ protected $ref; - /** - * The value for the export_category_id field. - * @var int - */ - protected $export_category_id; - /** * The value for the position field. * @var int */ protected $position; + /** + * The value for the export_category_id field. + * @var int + */ + protected $export_category_id; + /** * The value for the handle_class field. * @var string @@ -420,17 +420,6 @@ abstract class Export implements ActiveRecordInterface return $this->ref; } - /** - * Get the [export_category_id] column value. - * - * @return int - */ - public function getExportCategoryId() - { - - return $this->export_category_id; - } - /** * Get the [position] column value. * @@ -442,6 +431,17 @@ abstract class Export implements ActiveRecordInterface return $this->position; } + /** + * Get the [export_category_id] column value. + * + * @return int + */ + public function getExportCategoryId() + { + + return $this->export_category_id; + } + /** * Get the [handle_class] column value. * @@ -535,6 +535,27 @@ abstract class Export implements ActiveRecordInterface return $this; } // setRef() + /** + * Set the value of [position] column. + * + * @param int $v new value + * @return \Thelia\Model\Export The current object (for fluent API support) + */ + public function setPosition($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->position !== $v) { + $this->position = $v; + $this->modifiedColumns[ExportTableMap::POSITION] = true; + } + + + return $this; + } // setPosition() + /** * Set the value of [export_category_id] column. * @@ -560,27 +581,6 @@ abstract class Export implements ActiveRecordInterface return $this; } // setExportCategoryId() - /** - * Set the value of [position] column. - * - * @param int $v new value - * @return \Thelia\Model\Export The current object (for fluent API support) - */ - public function setPosition($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->position !== $v) { - $this->position = $v; - $this->modifiedColumns[ExportTableMap::POSITION] = true; - } - - - return $this; - } // setPosition() - /** * Set the value of [handle_class] column. * @@ -687,12 +687,12 @@ abstract class Export implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ExportTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)]; $this->ref = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ExportTableMap::translateFieldName('ExportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; - $this->export_category_id = (null !== $col) ? (int) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ExportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ExportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; $this->position = (null !== $col) ? (int) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ExportTableMap::translateFieldName('ExportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; + $this->export_category_id = (null !== $col) ? (int) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ExportTableMap::translateFieldName('HandleClass', TableMap::TYPE_PHPNAME, $indexType)]; $this->handle_class = (null !== $col) ? (string) $col : null; @@ -976,12 +976,12 @@ abstract class Export implements ActiveRecordInterface if ($this->isColumnModified(ExportTableMap::REF)) { $modifiedColumns[':p' . $index++] = '`REF`'; } - if ($this->isColumnModified(ExportTableMap::EXPORT_CATEGORY_ID)) { - $modifiedColumns[':p' . $index++] = '`EXPORT_CATEGORY_ID`'; - } if ($this->isColumnModified(ExportTableMap::POSITION)) { $modifiedColumns[':p' . $index++] = '`POSITION`'; } + if ($this->isColumnModified(ExportTableMap::EXPORT_CATEGORY_ID)) { + $modifiedColumns[':p' . $index++] = '`EXPORT_CATEGORY_ID`'; + } if ($this->isColumnModified(ExportTableMap::HANDLE_CLASS)) { $modifiedColumns[':p' . $index++] = '`HANDLE_CLASS`'; } @@ -1008,12 +1008,12 @@ abstract class Export implements ActiveRecordInterface case '`REF`': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case '`EXPORT_CATEGORY_ID`': - $stmt->bindValue($identifier, $this->export_category_id, PDO::PARAM_INT); - break; case '`POSITION`': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; + case '`EXPORT_CATEGORY_ID`': + $stmt->bindValue($identifier, $this->export_category_id, PDO::PARAM_INT); + break; case '`HANDLE_CLASS`': $stmt->bindValue($identifier, $this->handle_class, PDO::PARAM_STR); break; @@ -1092,10 +1092,10 @@ abstract class Export implements ActiveRecordInterface return $this->getRef(); break; case 2: - return $this->getExportCategoryId(); + return $this->getPosition(); break; case 3: - return $this->getPosition(); + return $this->getExportCategoryId(); break; case 4: return $this->getHandleClass(); @@ -1137,8 +1137,8 @@ abstract class Export implements ActiveRecordInterface $result = array( $keys[0] => $this->getId(), $keys[1] => $this->getRef(), - $keys[2] => $this->getExportCategoryId(), - $keys[3] => $this->getPosition(), + $keys[2] => $this->getPosition(), + $keys[3] => $this->getExportCategoryId(), $keys[4] => $this->getHandleClass(), $keys[5] => $this->getCreatedAt(), $keys[6] => $this->getUpdatedAt(), @@ -1196,10 +1196,10 @@ abstract class Export implements ActiveRecordInterface $this->setRef($value); break; case 2: - $this->setExportCategoryId($value); + $this->setPosition($value); break; case 3: - $this->setPosition($value); + $this->setExportCategoryId($value); break; case 4: $this->setHandleClass($value); @@ -1236,8 +1236,8 @@ abstract class Export implements ActiveRecordInterface if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setExportCategoryId($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setPosition($arr[$keys[3]]); + if (array_key_exists($keys[2], $arr)) $this->setPosition($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setExportCategoryId($arr[$keys[3]]); if (array_key_exists($keys[4], $arr)) $this->setHandleClass($arr[$keys[4]]); if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]); if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]); @@ -1254,8 +1254,8 @@ abstract class Export implements ActiveRecordInterface if ($this->isColumnModified(ExportTableMap::ID)) $criteria->add(ExportTableMap::ID, $this->id); if ($this->isColumnModified(ExportTableMap::REF)) $criteria->add(ExportTableMap::REF, $this->ref); - if ($this->isColumnModified(ExportTableMap::EXPORT_CATEGORY_ID)) $criteria->add(ExportTableMap::EXPORT_CATEGORY_ID, $this->export_category_id); if ($this->isColumnModified(ExportTableMap::POSITION)) $criteria->add(ExportTableMap::POSITION, $this->position); + if ($this->isColumnModified(ExportTableMap::EXPORT_CATEGORY_ID)) $criteria->add(ExportTableMap::EXPORT_CATEGORY_ID, $this->export_category_id); if ($this->isColumnModified(ExportTableMap::HANDLE_CLASS)) $criteria->add(ExportTableMap::HANDLE_CLASS, $this->handle_class); if ($this->isColumnModified(ExportTableMap::CREATED_AT)) $criteria->add(ExportTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ExportTableMap::UPDATED_AT)) $criteria->add(ExportTableMap::UPDATED_AT, $this->updated_at); @@ -1323,8 +1323,8 @@ abstract class Export implements ActiveRecordInterface public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setRef($this->getRef()); - $copyObj->setExportCategoryId($this->getExportCategoryId()); $copyObj->setPosition($this->getPosition()); + $copyObj->setExportCategoryId($this->getExportCategoryId()); $copyObj->setHandleClass($this->getHandleClass()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -1669,8 +1669,8 @@ abstract class Export implements ActiveRecordInterface { $this->id = null; $this->ref = null; - $this->export_category_id = null; $this->position = null; + $this->export_category_id = null; $this->handle_class = null; $this->created_at = null; $this->updated_at = null; @@ -1718,6 +1718,20 @@ abstract class Export implements ActiveRecordInterface return (string) $this->exportTo(ExportTableMap::DEFAULT_STRING_FORMAT); } + // timestampable behavior + + /** + * Mark the current object so that the update date doesn't get updated during next save + * + * @return ChildExport The current object (for fluent API support) + */ + public function keepUpdateDateUnchanged() + { + $this->modifiedColumns[ExportTableMap::UPDATED_AT] = true; + + return $this; + } + // i18n behavior /** @@ -1865,20 +1879,6 @@ abstract class Export implements ActiveRecordInterface return $this; } - // timestampable behavior - - /** - * Mark the current object so that the update date doesn't get updated during next save - * - * @return ChildExport The current object (for fluent API support) - */ - public function keepUpdateDateUnchanged() - { - $this->modifiedColumns[ExportTableMap::UPDATED_AT] = true; - - return $this; - } - /** * Code to be run before persisting the object * @param ConnectionInterface $con diff --git a/core/lib/Thelia/Model/Base/ExportQuery.php b/core/lib/Thelia/Model/Base/ExportQuery.php index 73397efb2..605eb401c 100644 --- a/core/lib/Thelia/Model/Base/ExportQuery.php +++ b/core/lib/Thelia/Model/Base/ExportQuery.php @@ -24,16 +24,16 @@ use Thelia\Model\Map\ExportTableMap; * * @method ChildExportQuery orderById($order = Criteria::ASC) Order by the id column * @method ChildExportQuery orderByRef($order = Criteria::ASC) Order by the ref column - * @method ChildExportQuery orderByExportCategoryId($order = Criteria::ASC) Order by the export_category_id column * @method ChildExportQuery orderByPosition($order = Criteria::ASC) Order by the position column + * @method ChildExportQuery orderByExportCategoryId($order = Criteria::ASC) Order by the export_category_id column * @method ChildExportQuery orderByHandleClass($order = Criteria::ASC) Order by the handle_class column * @method ChildExportQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildExportQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildExportQuery groupById() Group by the id column * @method ChildExportQuery groupByRef() Group by the ref column - * @method ChildExportQuery groupByExportCategoryId() Group by the export_category_id column * @method ChildExportQuery groupByPosition() Group by the position column + * @method ChildExportQuery groupByExportCategoryId() Group by the export_category_id column * @method ChildExportQuery groupByHandleClass() Group by the handle_class column * @method ChildExportQuery groupByCreatedAt() Group by the created_at column * @method ChildExportQuery groupByUpdatedAt() Group by the updated_at column @@ -55,16 +55,16 @@ use Thelia\Model\Map\ExportTableMap; * * @method ChildExport findOneById(int $id) Return the first ChildExport filtered by the id column * @method ChildExport findOneByRef(string $ref) Return the first ChildExport filtered by the ref column - * @method ChildExport findOneByExportCategoryId(int $export_category_id) Return the first ChildExport filtered by the export_category_id column * @method ChildExport findOneByPosition(int $position) Return the first ChildExport filtered by the position column + * @method ChildExport findOneByExportCategoryId(int $export_category_id) Return the first ChildExport filtered by the export_category_id column * @method ChildExport findOneByHandleClass(string $handle_class) Return the first ChildExport filtered by the handle_class column * @method ChildExport findOneByCreatedAt(string $created_at) Return the first ChildExport filtered by the created_at column * @method ChildExport findOneByUpdatedAt(string $updated_at) Return the first ChildExport filtered by the updated_at column * * @method array findById(int $id) Return ChildExport objects filtered by the id column * @method array findByRef(string $ref) Return ChildExport objects filtered by the ref column - * @method array findByExportCategoryId(int $export_category_id) Return ChildExport objects filtered by the export_category_id column * @method array findByPosition(int $position) Return ChildExport objects filtered by the position column + * @method array findByExportCategoryId(int $export_category_id) Return ChildExport objects filtered by the export_category_id column * @method array findByHandleClass(string $handle_class) Return ChildExport objects filtered by the handle_class column * @method array findByCreatedAt(string $created_at) Return ChildExport objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildExport objects filtered by the updated_at column @@ -156,7 +156,7 @@ abstract class ExportQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `REF`, `EXPORT_CATEGORY_ID`, `POSITION`, `HANDLE_CLASS`, `CREATED_AT`, `UPDATED_AT` FROM `export` WHERE `ID` = :p0'; + $sql = 'SELECT `ID`, `REF`, `POSITION`, `EXPORT_CATEGORY_ID`, `HANDLE_CLASS`, `CREATED_AT`, `UPDATED_AT` FROM `export` WHERE `ID` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -315,6 +315,47 @@ abstract class ExportQuery extends ModelCriteria return $this->addUsingAlias(ExportTableMap::REF, $ref, $comparison); } + /** + * Filter the query on the position column + * + * Example usage: + * + * $query->filterByPosition(1234); // WHERE position = 1234 + * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34) + * $query->filterByPosition(array('min' => 12)); // WHERE position > 12 + * + * + * @param mixed $position The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildExportQuery The current query, for fluid interface + */ + public function filterByPosition($position = null, $comparison = null) + { + if (is_array($position)) { + $useMinMax = false; + if (isset($position['min'])) { + $this->addUsingAlias(ExportTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($position['max'])) { + $this->addUsingAlias(ExportTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(ExportTableMap::POSITION, $position, $comparison); + } + /** * Filter the query on the export_category_id column * @@ -358,47 +399,6 @@ abstract class ExportQuery extends ModelCriteria return $this->addUsingAlias(ExportTableMap::EXPORT_CATEGORY_ID, $exportCategoryId, $comparison); } - /** - * Filter the query on the position column - * - * Example usage: - * - * $query->filterByPosition(1234); // WHERE position = 1234 - * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34) - * $query->filterByPosition(array('min' => 12)); // WHERE position > 12 - * - * - * @param mixed $position The value to use as filter. - * Use scalar values for equality. - * Use array values for in_array() equivalent. - * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildExportQuery The current query, for fluid interface - */ - public function filterByPosition($position = null, $comparison = null) - { - if (is_array($position)) { - $useMinMax = false; - if (isset($position['min'])) { - $this->addUsingAlias(ExportTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($position['max'])) { - $this->addUsingAlias(ExportTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ExportTableMap::POSITION, $position, $comparison); - } - /** * Filter the query on the handle_class column * @@ -753,63 +753,6 @@ abstract class ExportQuery extends ModelCriteria } } - // i18n behavior - - /** - * Adds a JOIN clause to the query using the i18n relation - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildExportQuery The current query, for fluid interface - */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - $relationName = $relationAlias ? $relationAlias : 'ExportI18n'; - - return $this - ->joinExportI18n($relationAlias, $joinType) - ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale); - } - - /** - * Adds a JOIN clause to the query and hydrates the related I18n object. - * Shortcut for $c->joinI18n($locale)->with() - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildExportQuery The current query, for fluid interface - */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) - { - $this - ->joinI18n($locale, null, $joinType) - ->with('ExportI18n'); - $this->with['ExportI18n']->setIsWithOneToMany(false); - - return $this; - } - - /** - * Use the I18n relation query object - * - * @see useQuery() - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildExportI18nQuery A secondary query class using the current class as primary query - */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinI18n($locale, $relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'ExportI18n', '\Thelia\Model\ExportI18nQuery'); - } - // timestampable behavior /** @@ -876,4 +819,61 @@ abstract class ExportQuery extends ModelCriteria return $this->addAscendingOrderByColumn(ExportTableMap::CREATED_AT); } + // i18n behavior + + /** + * Adds a JOIN clause to the query using the i18n relation + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildExportQuery The current query, for fluid interface + */ + public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + $relationName = $relationAlias ? $relationAlias : 'ExportI18n'; + + return $this + ->joinExportI18n($relationAlias, $joinType) + ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale); + } + + /** + * Adds a JOIN clause to the query and hydrates the related I18n object. + * Shortcut for $c->joinI18n($locale)->with() + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildExportQuery The current query, for fluid interface + */ + public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + { + $this + ->joinI18n($locale, null, $joinType) + ->with('ExportI18n'); + $this->with['ExportI18n']->setIsWithOneToMany(false); + + return $this; + } + + /** + * Use the I18n relation query object + * + * @see useQuery() + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildExportI18nQuery A secondary query class using the current class as primary query + */ + public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinI18n($locale, $relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'ExportI18n', '\Thelia\Model\ExportI18nQuery'); + } + } // ExportQuery diff --git a/core/lib/Thelia/Model/Base/Import.php b/core/lib/Thelia/Model/Base/Import.php index 0b65b3867..c8574d362 100644 --- a/core/lib/Thelia/Model/Base/Import.php +++ b/core/lib/Thelia/Model/Base/Import.php @@ -71,18 +71,18 @@ abstract class Import implements ActiveRecordInterface */ protected $ref; - /** - * The value for the import_category_id field. - * @var int - */ - protected $import_category_id; - /** * The value for the position field. * @var int */ protected $position; + /** + * The value for the import_category_id field. + * @var int + */ + protected $import_category_id; + /** * The value for the handle_class field. * @var string @@ -420,17 +420,6 @@ abstract class Import implements ActiveRecordInterface return $this->ref; } - /** - * Get the [import_category_id] column value. - * - * @return int - */ - public function getImportCategoryId() - { - - return $this->import_category_id; - } - /** * Get the [position] column value. * @@ -442,6 +431,17 @@ abstract class Import implements ActiveRecordInterface return $this->position; } + /** + * Get the [import_category_id] column value. + * + * @return int + */ + public function getImportCategoryId() + { + + return $this->import_category_id; + } + /** * Get the [handle_class] column value. * @@ -535,6 +535,27 @@ abstract class Import implements ActiveRecordInterface return $this; } // setRef() + /** + * Set the value of [position] column. + * + * @param int $v new value + * @return \Thelia\Model\Import The current object (for fluent API support) + */ + public function setPosition($v) + { + if ($v !== null) { + $v = (int) $v; + } + + if ($this->position !== $v) { + $this->position = $v; + $this->modifiedColumns[ImportTableMap::POSITION] = true; + } + + + return $this; + } // setPosition() + /** * Set the value of [import_category_id] column. * @@ -560,27 +581,6 @@ abstract class Import implements ActiveRecordInterface return $this; } // setImportCategoryId() - /** - * Set the value of [position] column. - * - * @param int $v new value - * @return \Thelia\Model\Import The current object (for fluent API support) - */ - public function setPosition($v) - { - if ($v !== null) { - $v = (int) $v; - } - - if ($this->position !== $v) { - $this->position = $v; - $this->modifiedColumns[ImportTableMap::POSITION] = true; - } - - - return $this; - } // setPosition() - /** * Set the value of [handle_class] column. * @@ -687,12 +687,12 @@ abstract class Import implements ActiveRecordInterface $col = $row[TableMap::TYPE_NUM == $indexType ? 1 + $startcol : ImportTableMap::translateFieldName('Ref', TableMap::TYPE_PHPNAME, $indexType)]; $this->ref = (null !== $col) ? (string) $col : null; - $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImportTableMap::translateFieldName('ImportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; - $this->import_category_id = (null !== $col) ? (int) $col : null; - - $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; + $col = $row[TableMap::TYPE_NUM == $indexType ? 2 + $startcol : ImportTableMap::translateFieldName('Position', TableMap::TYPE_PHPNAME, $indexType)]; $this->position = (null !== $col) ? (int) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 3 + $startcol : ImportTableMap::translateFieldName('ImportCategoryId', TableMap::TYPE_PHPNAME, $indexType)]; + $this->import_category_id = (null !== $col) ? (int) $col : null; + $col = $row[TableMap::TYPE_NUM == $indexType ? 4 + $startcol : ImportTableMap::translateFieldName('HandleClass', TableMap::TYPE_PHPNAME, $indexType)]; $this->handle_class = (null !== $col) ? (string) $col : null; @@ -976,12 +976,12 @@ abstract class Import implements ActiveRecordInterface if ($this->isColumnModified(ImportTableMap::REF)) { $modifiedColumns[':p' . $index++] = '`REF`'; } - if ($this->isColumnModified(ImportTableMap::IMPORT_CATEGORY_ID)) { - $modifiedColumns[':p' . $index++] = '`IMPORT_CATEGORY_ID`'; - } if ($this->isColumnModified(ImportTableMap::POSITION)) { $modifiedColumns[':p' . $index++] = '`POSITION`'; } + if ($this->isColumnModified(ImportTableMap::IMPORT_CATEGORY_ID)) { + $modifiedColumns[':p' . $index++] = '`IMPORT_CATEGORY_ID`'; + } if ($this->isColumnModified(ImportTableMap::HANDLE_CLASS)) { $modifiedColumns[':p' . $index++] = '`HANDLE_CLASS`'; } @@ -1008,12 +1008,12 @@ abstract class Import implements ActiveRecordInterface case '`REF`': $stmt->bindValue($identifier, $this->ref, PDO::PARAM_STR); break; - case '`IMPORT_CATEGORY_ID`': - $stmt->bindValue($identifier, $this->import_category_id, PDO::PARAM_INT); - break; case '`POSITION`': $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT); break; + case '`IMPORT_CATEGORY_ID`': + $stmt->bindValue($identifier, $this->import_category_id, PDO::PARAM_INT); + break; case '`HANDLE_CLASS`': $stmt->bindValue($identifier, $this->handle_class, PDO::PARAM_STR); break; @@ -1092,10 +1092,10 @@ abstract class Import implements ActiveRecordInterface return $this->getRef(); break; case 2: - return $this->getImportCategoryId(); + return $this->getPosition(); break; case 3: - return $this->getPosition(); + return $this->getImportCategoryId(); break; case 4: return $this->getHandleClass(); @@ -1137,8 +1137,8 @@ abstract class Import implements ActiveRecordInterface $result = array( $keys[0] => $this->getId(), $keys[1] => $this->getRef(), - $keys[2] => $this->getImportCategoryId(), - $keys[3] => $this->getPosition(), + $keys[2] => $this->getPosition(), + $keys[3] => $this->getImportCategoryId(), $keys[4] => $this->getHandleClass(), $keys[5] => $this->getCreatedAt(), $keys[6] => $this->getUpdatedAt(), @@ -1196,10 +1196,10 @@ abstract class Import implements ActiveRecordInterface $this->setRef($value); break; case 2: - $this->setImportCategoryId($value); + $this->setPosition($value); break; case 3: - $this->setPosition($value); + $this->setImportCategoryId($value); break; case 4: $this->setHandleClass($value); @@ -1236,8 +1236,8 @@ abstract class Import implements ActiveRecordInterface if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setRef($arr[$keys[1]]); - if (array_key_exists($keys[2], $arr)) $this->setImportCategoryId($arr[$keys[2]]); - if (array_key_exists($keys[3], $arr)) $this->setPosition($arr[$keys[3]]); + if (array_key_exists($keys[2], $arr)) $this->setPosition($arr[$keys[2]]); + if (array_key_exists($keys[3], $arr)) $this->setImportCategoryId($arr[$keys[3]]); if (array_key_exists($keys[4], $arr)) $this->setHandleClass($arr[$keys[4]]); if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]); if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]); @@ -1254,8 +1254,8 @@ abstract class Import implements ActiveRecordInterface if ($this->isColumnModified(ImportTableMap::ID)) $criteria->add(ImportTableMap::ID, $this->id); if ($this->isColumnModified(ImportTableMap::REF)) $criteria->add(ImportTableMap::REF, $this->ref); - if ($this->isColumnModified(ImportTableMap::IMPORT_CATEGORY_ID)) $criteria->add(ImportTableMap::IMPORT_CATEGORY_ID, $this->import_category_id); if ($this->isColumnModified(ImportTableMap::POSITION)) $criteria->add(ImportTableMap::POSITION, $this->position); + if ($this->isColumnModified(ImportTableMap::IMPORT_CATEGORY_ID)) $criteria->add(ImportTableMap::IMPORT_CATEGORY_ID, $this->import_category_id); if ($this->isColumnModified(ImportTableMap::HANDLE_CLASS)) $criteria->add(ImportTableMap::HANDLE_CLASS, $this->handle_class); if ($this->isColumnModified(ImportTableMap::CREATED_AT)) $criteria->add(ImportTableMap::CREATED_AT, $this->created_at); if ($this->isColumnModified(ImportTableMap::UPDATED_AT)) $criteria->add(ImportTableMap::UPDATED_AT, $this->updated_at); @@ -1323,8 +1323,8 @@ abstract class Import implements ActiveRecordInterface public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setRef($this->getRef()); - $copyObj->setImportCategoryId($this->getImportCategoryId()); $copyObj->setPosition($this->getPosition()); + $copyObj->setImportCategoryId($this->getImportCategoryId()); $copyObj->setHandleClass($this->getHandleClass()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); @@ -1669,8 +1669,8 @@ abstract class Import implements ActiveRecordInterface { $this->id = null; $this->ref = null; - $this->import_category_id = null; $this->position = null; + $this->import_category_id = null; $this->handle_class = null; $this->created_at = null; $this->updated_at = null; @@ -1718,6 +1718,20 @@ abstract class Import implements ActiveRecordInterface return (string) $this->exportTo(ImportTableMap::DEFAULT_STRING_FORMAT); } + // timestampable behavior + + /** + * Mark the current object so that the update date doesn't get updated during next save + * + * @return ChildImport The current object (for fluent API support) + */ + public function keepUpdateDateUnchanged() + { + $this->modifiedColumns[ImportTableMap::UPDATED_AT] = true; + + return $this; + } + // i18n behavior /** @@ -1865,20 +1879,6 @@ abstract class Import implements ActiveRecordInterface return $this; } - // timestampable behavior - - /** - * Mark the current object so that the update date doesn't get updated during next save - * - * @return ChildImport The current object (for fluent API support) - */ - public function keepUpdateDateUnchanged() - { - $this->modifiedColumns[ImportTableMap::UPDATED_AT] = true; - - return $this; - } - /** * Code to be run before persisting the object * @param ConnectionInterface $con diff --git a/core/lib/Thelia/Model/Base/ImportCategory.php b/core/lib/Thelia/Model/Base/ImportCategory.php index 2822e810b..ee7f0a945 100644 --- a/core/lib/Thelia/Model/Base/ImportCategory.php +++ b/core/lib/Thelia/Model/Base/ImportCategory.php @@ -1789,6 +1789,20 @@ abstract class ImportCategory implements ActiveRecordInterface return (string) $this->exportTo(ImportCategoryTableMap::DEFAULT_STRING_FORMAT); } + // timestampable behavior + + /** + * Mark the current object so that the update date doesn't get updated during next save + * + * @return ChildImportCategory The current object (for fluent API support) + */ + public function keepUpdateDateUnchanged() + { + $this->modifiedColumns[ImportCategoryTableMap::UPDATED_AT] = true; + + return $this; + } + // i18n behavior /** @@ -1912,20 +1926,6 @@ abstract class ImportCategory implements ActiveRecordInterface return $this; } - // timestampable behavior - - /** - * Mark the current object so that the update date doesn't get updated during next save - * - * @return ChildImportCategory The current object (for fluent API support) - */ - public function keepUpdateDateUnchanged() - { - $this->modifiedColumns[ImportCategoryTableMap::UPDATED_AT] = true; - - return $this; - } - /** * Code to be run before persisting the object * @param ConnectionInterface $con diff --git a/core/lib/Thelia/Model/Base/ImportCategoryQuery.php b/core/lib/Thelia/Model/Base/ImportCategoryQuery.php index a9dd3115c..f14f1ffc4 100644 --- a/core/lib/Thelia/Model/Base/ImportCategoryQuery.php +++ b/core/lib/Thelia/Model/Base/ImportCategoryQuery.php @@ -671,63 +671,6 @@ abstract class ImportCategoryQuery extends ModelCriteria } } - // i18n behavior - - /** - * Adds a JOIN clause to the query using the i18n relation - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildImportCategoryQuery The current query, for fluid interface - */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - $relationName = $relationAlias ? $relationAlias : 'ImportCategoryI18n'; - - return $this - ->joinImportCategoryI18n($relationAlias, $joinType) - ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale); - } - - /** - * Adds a JOIN clause to the query and hydrates the related I18n object. - * Shortcut for $c->joinI18n($locale)->with() - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildImportCategoryQuery The current query, for fluid interface - */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) - { - $this - ->joinI18n($locale, null, $joinType) - ->with('ImportCategoryI18n'); - $this->with['ImportCategoryI18n']->setIsWithOneToMany(false); - - return $this; - } - - /** - * Use the I18n relation query object - * - * @see useQuery() - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildImportCategoryI18nQuery A secondary query class using the current class as primary query - */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinI18n($locale, $relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'ImportCategoryI18n', '\Thelia\Model\ImportCategoryI18nQuery'); - } - // timestampable behavior /** @@ -794,4 +737,61 @@ abstract class ImportCategoryQuery extends ModelCriteria return $this->addAscendingOrderByColumn(ImportCategoryTableMap::CREATED_AT); } + // i18n behavior + + /** + * Adds a JOIN clause to the query using the i18n relation + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildImportCategoryQuery The current query, for fluid interface + */ + public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + $relationName = $relationAlias ? $relationAlias : 'ImportCategoryI18n'; + + return $this + ->joinImportCategoryI18n($relationAlias, $joinType) + ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale); + } + + /** + * Adds a JOIN clause to the query and hydrates the related I18n object. + * Shortcut for $c->joinI18n($locale)->with() + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildImportCategoryQuery The current query, for fluid interface + */ + public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + { + $this + ->joinI18n($locale, null, $joinType) + ->with('ImportCategoryI18n'); + $this->with['ImportCategoryI18n']->setIsWithOneToMany(false); + + return $this; + } + + /** + * Use the I18n relation query object + * + * @see useQuery() + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildImportCategoryI18nQuery A secondary query class using the current class as primary query + */ + public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinI18n($locale, $relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'ImportCategoryI18n', '\Thelia\Model\ImportCategoryI18nQuery'); + } + } // ImportCategoryQuery diff --git a/core/lib/Thelia/Model/Base/ImportQuery.php b/core/lib/Thelia/Model/Base/ImportQuery.php index 434952923..9d6f9a412 100644 --- a/core/lib/Thelia/Model/Base/ImportQuery.php +++ b/core/lib/Thelia/Model/Base/ImportQuery.php @@ -24,16 +24,16 @@ use Thelia\Model\Map\ImportTableMap; * * @method ChildImportQuery orderById($order = Criteria::ASC) Order by the id column * @method ChildImportQuery orderByRef($order = Criteria::ASC) Order by the ref column - * @method ChildImportQuery orderByImportCategoryId($order = Criteria::ASC) Order by the import_category_id column * @method ChildImportQuery orderByPosition($order = Criteria::ASC) Order by the position column + * @method ChildImportQuery orderByImportCategoryId($order = Criteria::ASC) Order by the import_category_id column * @method ChildImportQuery orderByHandleClass($order = Criteria::ASC) Order by the handle_class column * @method ChildImportQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column * @method ChildImportQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column * * @method ChildImportQuery groupById() Group by the id column * @method ChildImportQuery groupByRef() Group by the ref column - * @method ChildImportQuery groupByImportCategoryId() Group by the import_category_id column * @method ChildImportQuery groupByPosition() Group by the position column + * @method ChildImportQuery groupByImportCategoryId() Group by the import_category_id column * @method ChildImportQuery groupByHandleClass() Group by the handle_class column * @method ChildImportQuery groupByCreatedAt() Group by the created_at column * @method ChildImportQuery groupByUpdatedAt() Group by the updated_at column @@ -55,16 +55,16 @@ use Thelia\Model\Map\ImportTableMap; * * @method ChildImport findOneById(int $id) Return the first ChildImport filtered by the id column * @method ChildImport findOneByRef(string $ref) Return the first ChildImport filtered by the ref column - * @method ChildImport findOneByImportCategoryId(int $import_category_id) Return the first ChildImport filtered by the import_category_id column * @method ChildImport findOneByPosition(int $position) Return the first ChildImport filtered by the position column + * @method ChildImport findOneByImportCategoryId(int $import_category_id) Return the first ChildImport filtered by the import_category_id column * @method ChildImport findOneByHandleClass(string $handle_class) Return the first ChildImport filtered by the handle_class column * @method ChildImport findOneByCreatedAt(string $created_at) Return the first ChildImport filtered by the created_at column * @method ChildImport findOneByUpdatedAt(string $updated_at) Return the first ChildImport filtered by the updated_at column * * @method array findById(int $id) Return ChildImport objects filtered by the id column * @method array findByRef(string $ref) Return ChildImport objects filtered by the ref column - * @method array findByImportCategoryId(int $import_category_id) Return ChildImport objects filtered by the import_category_id column * @method array findByPosition(int $position) Return ChildImport objects filtered by the position column + * @method array findByImportCategoryId(int $import_category_id) Return ChildImport objects filtered by the import_category_id column * @method array findByHandleClass(string $handle_class) Return ChildImport objects filtered by the handle_class column * @method array findByCreatedAt(string $created_at) Return ChildImport objects filtered by the created_at column * @method array findByUpdatedAt(string $updated_at) Return ChildImport objects filtered by the updated_at column @@ -156,7 +156,7 @@ abstract class ImportQuery extends ModelCriteria */ protected function findPkSimple($key, $con) { - $sql = 'SELECT `ID`, `REF`, `IMPORT_CATEGORY_ID`, `POSITION`, `HANDLE_CLASS`, `CREATED_AT`, `UPDATED_AT` FROM `import` WHERE `ID` = :p0'; + $sql = 'SELECT `ID`, `REF`, `POSITION`, `IMPORT_CATEGORY_ID`, `HANDLE_CLASS`, `CREATED_AT`, `UPDATED_AT` FROM `import` WHERE `ID` = :p0'; try { $stmt = $con->prepare($sql); $stmt->bindValue(':p0', $key, PDO::PARAM_INT); @@ -315,6 +315,47 @@ abstract class ImportQuery extends ModelCriteria return $this->addUsingAlias(ImportTableMap::REF, $ref, $comparison); } + /** + * Filter the query on the position column + * + * Example usage: + * + * $query->filterByPosition(1234); // WHERE position = 1234 + * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34) + * $query->filterByPosition(array('min' => 12)); // WHERE position > 12 + * + * + * @param mixed $position The value to use as filter. + * Use scalar values for equality. + * Use array values for in_array() equivalent. + * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. + * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL + * + * @return ChildImportQuery The current query, for fluid interface + */ + public function filterByPosition($position = null, $comparison = null) + { + if (is_array($position)) { + $useMinMax = false; + if (isset($position['min'])) { + $this->addUsingAlias(ImportTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL); + $useMinMax = true; + } + if (isset($position['max'])) { + $this->addUsingAlias(ImportTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL); + $useMinMax = true; + } + if ($useMinMax) { + return $this; + } + if (null === $comparison) { + $comparison = Criteria::IN; + } + } + + return $this->addUsingAlias(ImportTableMap::POSITION, $position, $comparison); + } + /** * Filter the query on the import_category_id column * @@ -358,47 +399,6 @@ abstract class ImportQuery extends ModelCriteria return $this->addUsingAlias(ImportTableMap::IMPORT_CATEGORY_ID, $importCategoryId, $comparison); } - /** - * Filter the query on the position column - * - * Example usage: - * - * $query->filterByPosition(1234); // WHERE position = 1234 - * $query->filterByPosition(array(12, 34)); // WHERE position IN (12, 34) - * $query->filterByPosition(array('min' => 12)); // WHERE position > 12 - * - * - * @param mixed $position The value to use as filter. - * Use scalar values for equality. - * Use array values for in_array() equivalent. - * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals. - * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL - * - * @return ChildImportQuery The current query, for fluid interface - */ - public function filterByPosition($position = null, $comparison = null) - { - if (is_array($position)) { - $useMinMax = false; - if (isset($position['min'])) { - $this->addUsingAlias(ImportTableMap::POSITION, $position['min'], Criteria::GREATER_EQUAL); - $useMinMax = true; - } - if (isset($position['max'])) { - $this->addUsingAlias(ImportTableMap::POSITION, $position['max'], Criteria::LESS_EQUAL); - $useMinMax = true; - } - if ($useMinMax) { - return $this; - } - if (null === $comparison) { - $comparison = Criteria::IN; - } - } - - return $this->addUsingAlias(ImportTableMap::POSITION, $position, $comparison); - } - /** * Filter the query on the handle_class column * @@ -753,63 +753,6 @@ abstract class ImportQuery extends ModelCriteria } } - // i18n behavior - - /** - * Adds a JOIN clause to the query using the i18n relation - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildImportQuery The current query, for fluid interface - */ - public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - $relationName = $relationAlias ? $relationAlias : 'ImportI18n'; - - return $this - ->joinImportI18n($relationAlias, $joinType) - ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale); - } - - /** - * Adds a JOIN clause to the query and hydrates the related I18n object. - * Shortcut for $c->joinI18n($locale)->with() - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildImportQuery The current query, for fluid interface - */ - public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) - { - $this - ->joinI18n($locale, null, $joinType) - ->with('ImportI18n'); - $this->with['ImportI18n']->setIsWithOneToMany(false); - - return $this; - } - - /** - * Use the I18n relation query object - * - * @see useQuery() - * - * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' - * @param string $relationAlias optional alias for the relation - * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. - * - * @return ChildImportI18nQuery A secondary query class using the current class as primary query - */ - public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) - { - return $this - ->joinI18n($locale, $relationAlias, $joinType) - ->useQuery($relationAlias ? $relationAlias : 'ImportI18n', '\Thelia\Model\ImportI18nQuery'); - } - // timestampable behavior /** @@ -876,4 +819,61 @@ abstract class ImportQuery extends ModelCriteria return $this->addAscendingOrderByColumn(ImportTableMap::CREATED_AT); } + // i18n behavior + + /** + * Adds a JOIN clause to the query using the i18n relation + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildImportQuery The current query, for fluid interface + */ + public function joinI18n($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + $relationName = $relationAlias ? $relationAlias : 'ImportI18n'; + + return $this + ->joinImportI18n($relationAlias, $joinType) + ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale); + } + + /** + * Adds a JOIN clause to the query and hydrates the related I18n object. + * Shortcut for $c->joinI18n($locale)->with() + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildImportQuery The current query, for fluid interface + */ + public function joinWithI18n($locale = 'en_US', $joinType = Criteria::LEFT_JOIN) + { + $this + ->joinI18n($locale, null, $joinType) + ->with('ImportI18n'); + $this->with['ImportI18n']->setIsWithOneToMany(false); + + return $this; + } + + /** + * Use the I18n relation query object + * + * @see useQuery() + * + * @param string $locale Locale to use for the join condition, e.g. 'fr_FR' + * @param string $relationAlias optional alias for the relation + * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join. + * + * @return ChildImportI18nQuery A secondary query class using the current class as primary query + */ + public function useI18nQuery($locale = 'en_US', $relationAlias = null, $joinType = Criteria::LEFT_JOIN) + { + return $this + ->joinI18n($locale, $relationAlias, $joinType) + ->useQuery($relationAlias ? $relationAlias : 'ImportI18n', '\Thelia\Model\ImportI18nQuery'); + } + } // ImportQuery diff --git a/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php b/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php index b5888f849..d875dc85f 100644 --- a/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php +++ b/core/lib/Thelia/Model/Map/ExportCategoryTableMap.php @@ -167,7 +167,7 @@ class ExportCategoryTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Export', '\\Thelia\\Model\\Export', RelationMap::ONE_TO_MANY, array('id' => 'export_category_id', ), 'CASCADE', 'RESTRICT', 'Exports'); + $this->addRelation('Export', '\\Thelia\\Model\\Export', RelationMap::ONE_TO_MANY, array('id' => 'export_category_id', ), null, null, 'Exports'); $this->addRelation('ExportCategoryI18n', '\\Thelia\\Model\\ExportCategoryI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ExportCategoryI18ns'); } // buildRelations() @@ -191,7 +191,6 @@ class ExportCategoryTableMap extends TableMap { // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - ExportTableMap::clearInstancePool(); ExportCategoryI18nTableMap::clearInstancePool(); } diff --git a/core/lib/Thelia/Model/Map/ExportI18nTableMap.php b/core/lib/Thelia/Model/Map/ExportI18nTableMap.php index 228a4e288..8c1e3e669 100644 --- a/core/lib/Thelia/Model/Map/ExportI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ExportI18nTableMap.php @@ -144,7 +144,7 @@ class ExportI18nTableMap extends TableMap $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'export', 'ID', true, null, null); $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); $this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null); - $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); + $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null); } // initialize() /** diff --git a/core/lib/Thelia/Model/Map/ExportTableMap.php b/core/lib/Thelia/Model/Map/ExportTableMap.php index 27293ab25..222387116 100644 --- a/core/lib/Thelia/Model/Map/ExportTableMap.php +++ b/core/lib/Thelia/Model/Map/ExportTableMap.php @@ -80,16 +80,16 @@ class ExportTableMap extends TableMap */ const REF = 'export.REF'; - /** - * the column name for the EXPORT_CATEGORY_ID field - */ - const EXPORT_CATEGORY_ID = 'export.EXPORT_CATEGORY_ID'; - /** * the column name for the POSITION field */ const POSITION = 'export.POSITION'; + /** + * the column name for the EXPORT_CATEGORY_ID field + */ + const EXPORT_CATEGORY_ID = 'export.EXPORT_CATEGORY_ID'; + /** * the column name for the HANDLE_CLASS field */ @@ -126,11 +126,11 @@ class ExportTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'Ref', 'ExportCategoryId', 'Position', 'HandleClass', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'exportCategoryId', 'position', 'handleClass', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ExportTableMap::ID, ExportTableMap::REF, ExportTableMap::EXPORT_CATEGORY_ID, ExportTableMap::POSITION, ExportTableMap::HANDLE_CLASS, ExportTableMap::CREATED_AT, ExportTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'REF', 'EXPORT_CATEGORY_ID', 'POSITION', 'HANDLE_CLASS', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'ref', 'export_category_id', 'position', 'handle_class', 'created_at', 'updated_at', ), + self::TYPE_PHPNAME => array('Id', 'Ref', 'Position', 'ExportCategoryId', 'HandleClass', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'position', 'exportCategoryId', 'handleClass', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ExportTableMap::ID, ExportTableMap::REF, ExportTableMap::POSITION, ExportTableMap::EXPORT_CATEGORY_ID, ExportTableMap::HANDLE_CLASS, ExportTableMap::CREATED_AT, ExportTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'POSITION', 'EXPORT_CATEGORY_ID', 'HANDLE_CLASS', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'position', 'export_category_id', 'handle_class', 'created_at', 'updated_at', ), self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); @@ -141,11 +141,11 @@ class ExportTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'ExportCategoryId' => 2, 'Position' => 3, 'HandleClass' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'exportCategoryId' => 2, 'position' => 3, 'handleClass' => 4, 'createdAt' => 5, 'updatedAt' => 6, ), - self::TYPE_COLNAME => array(ExportTableMap::ID => 0, ExportTableMap::REF => 1, ExportTableMap::EXPORT_CATEGORY_ID => 2, ExportTableMap::POSITION => 3, ExportTableMap::HANDLE_CLASS => 4, ExportTableMap::CREATED_AT => 5, ExportTableMap::UPDATED_AT => 6, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'EXPORT_CATEGORY_ID' => 2, 'POSITION' => 3, 'HANDLE_CLASS' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ), - self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'export_category_id' => 2, 'position' => 3, 'handle_class' => 4, 'created_at' => 5, 'updated_at' => 6, ), + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'Position' => 2, 'ExportCategoryId' => 3, 'HandleClass' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'exportCategoryId' => 3, 'handleClass' => 4, 'createdAt' => 5, 'updatedAt' => 6, ), + self::TYPE_COLNAME => array(ExportTableMap::ID => 0, ExportTableMap::REF => 1, ExportTableMap::POSITION => 2, ExportTableMap::EXPORT_CATEGORY_ID => 3, ExportTableMap::HANDLE_CLASS => 4, ExportTableMap::CREATED_AT => 5, ExportTableMap::UPDATED_AT => 6, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'POSITION' => 2, 'EXPORT_CATEGORY_ID' => 3, 'HANDLE_CLASS' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'export_category_id' => 3, 'handle_class' => 4, 'created_at' => 5, 'updated_at' => 6, ), self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); @@ -167,9 +167,9 @@ class ExportTableMap extends TableMap // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); $this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null); - $this->addForeignKey('EXPORT_CATEGORY_ID', 'ExportCategoryId', 'INTEGER', 'export_category', 'ID', true, null, null); $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null); - $this->addColumn('HANDLE_CLASS', 'HandleClass', 'CLOB', true, null, null); + $this->addForeignKey('EXPORT_CATEGORY_ID', 'ExportCategoryId', 'INTEGER', 'export_category', 'ID', true, null, null); + $this->addColumn('HANDLE_CLASS', 'HandleClass', 'LONGVARCHAR', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -179,7 +179,7 @@ class ExportTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('ExportCategory', '\\Thelia\\Model\\ExportCategory', RelationMap::MANY_TO_ONE, array('export_category_id' => 'id', ), 'CASCADE', 'RESTRICT'); + $this->addRelation('ExportCategory', '\\Thelia\\Model\\ExportCategory', RelationMap::MANY_TO_ONE, array('export_category_id' => 'id', ), null, null); $this->addRelation('ExportI18n', '\\Thelia\\Model\\ExportI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ExportI18ns'); } // buildRelations() @@ -192,8 +192,8 @@ class ExportTableMap extends TableMap public function getBehaviors() { return array( - 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ), 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ), + 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title,description', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ), ); } // getBehaviors() /** @@ -346,16 +346,16 @@ class ExportTableMap extends TableMap if (null === $alias) { $criteria->addSelectColumn(ExportTableMap::ID); $criteria->addSelectColumn(ExportTableMap::REF); - $criteria->addSelectColumn(ExportTableMap::EXPORT_CATEGORY_ID); $criteria->addSelectColumn(ExportTableMap::POSITION); + $criteria->addSelectColumn(ExportTableMap::EXPORT_CATEGORY_ID); $criteria->addSelectColumn(ExportTableMap::HANDLE_CLASS); $criteria->addSelectColumn(ExportTableMap::CREATED_AT); $criteria->addSelectColumn(ExportTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.REF'); - $criteria->addSelectColumn($alias . '.EXPORT_CATEGORY_ID'); $criteria->addSelectColumn($alias . '.POSITION'); + $criteria->addSelectColumn($alias . '.EXPORT_CATEGORY_ID'); $criteria->addSelectColumn($alias . '.HANDLE_CLASS'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); diff --git a/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php b/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php index 82966e1b1..1bee217ba 100644 --- a/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php +++ b/core/lib/Thelia/Model/Map/ImportCategoryTableMap.php @@ -167,7 +167,7 @@ class ImportCategoryTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('Import', '\\Thelia\\Model\\Import', RelationMap::ONE_TO_MANY, array('id' => 'import_category_id', ), 'CASCADE', 'RESTRICT', 'Imports'); + $this->addRelation('Import', '\\Thelia\\Model\\Import', RelationMap::ONE_TO_MANY, array('id' => 'import_category_id', ), null, null, 'Imports'); $this->addRelation('ImportCategoryI18n', '\\Thelia\\Model\\ImportCategoryI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ImportCategoryI18ns'); } // buildRelations() @@ -180,8 +180,8 @@ class ImportCategoryTableMap extends TableMap public function getBehaviors() { return array( - 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ), 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ), + 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ), ); } // getBehaviors() /** @@ -191,7 +191,6 @@ class ImportCategoryTableMap extends TableMap { // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. - ImportTableMap::clearInstancePool(); ImportCategoryI18nTableMap::clearInstancePool(); } diff --git a/core/lib/Thelia/Model/Map/ImportI18nTableMap.php b/core/lib/Thelia/Model/Map/ImportI18nTableMap.php index 98279a3c8..5efb8e7f9 100644 --- a/core/lib/Thelia/Model/Map/ImportI18nTableMap.php +++ b/core/lib/Thelia/Model/Map/ImportI18nTableMap.php @@ -144,7 +144,7 @@ class ImportI18nTableMap extends TableMap $this->addForeignPrimaryKey('ID', 'Id', 'INTEGER' , 'import', 'ID', true, null, null); $this->addPrimaryKey('LOCALE', 'Locale', 'VARCHAR', true, 5, 'en_US'); $this->addColumn('TITLE', 'Title', 'VARCHAR', true, 255, null); - $this->addColumn('DESCRIPTION', 'Description', 'CLOB', false, null, null); + $this->addColumn('DESCRIPTION', 'Description', 'LONGVARCHAR', false, null, null); } // initialize() /** diff --git a/core/lib/Thelia/Model/Map/ImportTableMap.php b/core/lib/Thelia/Model/Map/ImportTableMap.php index 56cbe3592..7b59a2200 100644 --- a/core/lib/Thelia/Model/Map/ImportTableMap.php +++ b/core/lib/Thelia/Model/Map/ImportTableMap.php @@ -80,16 +80,16 @@ class ImportTableMap extends TableMap */ const REF = 'import.REF'; - /** - * the column name for the IMPORT_CATEGORY_ID field - */ - const IMPORT_CATEGORY_ID = 'import.IMPORT_CATEGORY_ID'; - /** * the column name for the POSITION field */ const POSITION = 'import.POSITION'; + /** + * the column name for the IMPORT_CATEGORY_ID field + */ + const IMPORT_CATEGORY_ID = 'import.IMPORT_CATEGORY_ID'; + /** * the column name for the HANDLE_CLASS field */ @@ -126,11 +126,11 @@ class ImportTableMap extends TableMap * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id' */ protected static $fieldNames = array ( - self::TYPE_PHPNAME => array('Id', 'Ref', 'ImportCategoryId', 'Position', 'HandleClass', 'CreatedAt', 'UpdatedAt', ), - self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'importCategoryId', 'position', 'handleClass', 'createdAt', 'updatedAt', ), - self::TYPE_COLNAME => array(ImportTableMap::ID, ImportTableMap::REF, ImportTableMap::IMPORT_CATEGORY_ID, ImportTableMap::POSITION, ImportTableMap::HANDLE_CLASS, ImportTableMap::CREATED_AT, ImportTableMap::UPDATED_AT, ), - self::TYPE_RAW_COLNAME => array('ID', 'REF', 'IMPORT_CATEGORY_ID', 'POSITION', 'HANDLE_CLASS', 'CREATED_AT', 'UPDATED_AT', ), - self::TYPE_FIELDNAME => array('id', 'ref', 'import_category_id', 'position', 'handle_class', 'created_at', 'updated_at', ), + self::TYPE_PHPNAME => array('Id', 'Ref', 'Position', 'ImportCategoryId', 'HandleClass', 'CreatedAt', 'UpdatedAt', ), + self::TYPE_STUDLYPHPNAME => array('id', 'ref', 'position', 'importCategoryId', 'handleClass', 'createdAt', 'updatedAt', ), + self::TYPE_COLNAME => array(ImportTableMap::ID, ImportTableMap::REF, ImportTableMap::POSITION, ImportTableMap::IMPORT_CATEGORY_ID, ImportTableMap::HANDLE_CLASS, ImportTableMap::CREATED_AT, ImportTableMap::UPDATED_AT, ), + self::TYPE_RAW_COLNAME => array('ID', 'REF', 'POSITION', 'IMPORT_CATEGORY_ID', 'HANDLE_CLASS', 'CREATED_AT', 'UPDATED_AT', ), + self::TYPE_FIELDNAME => array('id', 'ref', 'position', 'import_category_id', 'handle_class', 'created_at', 'updated_at', ), self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); @@ -141,11 +141,11 @@ class ImportTableMap extends TableMap * e.g. self::$fieldKeys[self::TYPE_PHPNAME]['Id'] = 0 */ protected static $fieldKeys = array ( - self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'ImportCategoryId' => 2, 'Position' => 3, 'HandleClass' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ), - self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'importCategoryId' => 2, 'position' => 3, 'handleClass' => 4, 'createdAt' => 5, 'updatedAt' => 6, ), - self::TYPE_COLNAME => array(ImportTableMap::ID => 0, ImportTableMap::REF => 1, ImportTableMap::IMPORT_CATEGORY_ID => 2, ImportTableMap::POSITION => 3, ImportTableMap::HANDLE_CLASS => 4, ImportTableMap::CREATED_AT => 5, ImportTableMap::UPDATED_AT => 6, ), - self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'IMPORT_CATEGORY_ID' => 2, 'POSITION' => 3, 'HANDLE_CLASS' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ), - self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'import_category_id' => 2, 'position' => 3, 'handle_class' => 4, 'created_at' => 5, 'updated_at' => 6, ), + self::TYPE_PHPNAME => array('Id' => 0, 'Ref' => 1, 'Position' => 2, 'ImportCategoryId' => 3, 'HandleClass' => 4, 'CreatedAt' => 5, 'UpdatedAt' => 6, ), + self::TYPE_STUDLYPHPNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'importCategoryId' => 3, 'handleClass' => 4, 'createdAt' => 5, 'updatedAt' => 6, ), + self::TYPE_COLNAME => array(ImportTableMap::ID => 0, ImportTableMap::REF => 1, ImportTableMap::POSITION => 2, ImportTableMap::IMPORT_CATEGORY_ID => 3, ImportTableMap::HANDLE_CLASS => 4, ImportTableMap::CREATED_AT => 5, ImportTableMap::UPDATED_AT => 6, ), + self::TYPE_RAW_COLNAME => array('ID' => 0, 'REF' => 1, 'POSITION' => 2, 'IMPORT_CATEGORY_ID' => 3, 'HANDLE_CLASS' => 4, 'CREATED_AT' => 5, 'UPDATED_AT' => 6, ), + self::TYPE_FIELDNAME => array('id' => 0, 'ref' => 1, 'position' => 2, 'import_category_id' => 3, 'handle_class' => 4, 'created_at' => 5, 'updated_at' => 6, ), self::TYPE_NUM => array(0, 1, 2, 3, 4, 5, 6, ) ); @@ -167,9 +167,9 @@ class ImportTableMap extends TableMap // columns $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); $this->addColumn('REF', 'Ref', 'VARCHAR', true, 255, null); - $this->addForeignKey('IMPORT_CATEGORY_ID', 'ImportCategoryId', 'INTEGER', 'import_category', 'ID', true, null, null); $this->addColumn('POSITION', 'Position', 'INTEGER', true, null, null); - $this->addColumn('HANDLE_CLASS', 'HandleClass', 'CLOB', true, null, null); + $this->addForeignKey('IMPORT_CATEGORY_ID', 'ImportCategoryId', 'INTEGER', 'import_category', 'ID', true, null, null); + $this->addColumn('HANDLE_CLASS', 'HandleClass', 'LONGVARCHAR', true, null, null); $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null); } // initialize() @@ -179,7 +179,7 @@ class ImportTableMap extends TableMap */ public function buildRelations() { - $this->addRelation('ImportCategory', '\\Thelia\\Model\\ImportCategory', RelationMap::MANY_TO_ONE, array('import_category_id' => 'id', ), 'CASCADE', 'RESTRICT'); + $this->addRelation('ImportCategory', '\\Thelia\\Model\\ImportCategory', RelationMap::MANY_TO_ONE, array('import_category_id' => 'id', ), null, null); $this->addRelation('ImportI18n', '\\Thelia\\Model\\ImportI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'ImportI18ns'); } // buildRelations() @@ -192,8 +192,8 @@ class ImportTableMap extends TableMap public function getBehaviors() { return array( - 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title, description', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ), 'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', ), + 'i18n' => array('i18n_table' => '%TABLE%_i18n', 'i18n_phpname' => '%PHPNAME%I18n', 'i18n_columns' => 'title,description', 'locale_column' => 'locale', 'locale_length' => '5', 'default_locale' => '', 'locale_alias' => '', ), ); } // getBehaviors() /** @@ -346,16 +346,16 @@ class ImportTableMap extends TableMap if (null === $alias) { $criteria->addSelectColumn(ImportTableMap::ID); $criteria->addSelectColumn(ImportTableMap::REF); - $criteria->addSelectColumn(ImportTableMap::IMPORT_CATEGORY_ID); $criteria->addSelectColumn(ImportTableMap::POSITION); + $criteria->addSelectColumn(ImportTableMap::IMPORT_CATEGORY_ID); $criteria->addSelectColumn(ImportTableMap::HANDLE_CLASS); $criteria->addSelectColumn(ImportTableMap::CREATED_AT); $criteria->addSelectColumn(ImportTableMap::UPDATED_AT); } else { $criteria->addSelectColumn($alias . '.ID'); $criteria->addSelectColumn($alias . '.REF'); - $criteria->addSelectColumn($alias . '.IMPORT_CATEGORY_ID'); $criteria->addSelectColumn($alias . '.POSITION'); + $criteria->addSelectColumn($alias . '.IMPORT_CATEGORY_ID'); $criteria->addSelectColumn($alias . '.HANDLE_CLASS'); $criteria->addSelectColumn($alias . '.CREATED_AT'); $criteria->addSelectColumn($alias . '.UPDATED_AT'); diff --git a/local/config/schema.xml b/local/config/schema.xml index cc9ba99f9..06071b525 100644 --- a/local/config/schema.xml +++ b/local/config/schema.xml @@ -1,1589 +1,1593 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+
diff --git a/setup/thelia.sql b/setup/thelia.sql index 38f5f61bf..94f851f0e 100644 --- a/setup/thelia.sql +++ b/setup/thelia.sql @@ -23,7 +23,7 @@ CREATE TABLE `category` PRIMARY KEY (`id`), INDEX `idx_parent` (`parent`), INDEX `idx_parent_position` (`parent`, `position`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product @@ -64,7 +64,7 @@ CREATE TABLE `product` REFERENCES `brand` (`id`) ON UPDATE RESTRICT ON DELETE SET NULL -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_category @@ -93,7 +93,7 @@ CREATE TABLE `product_category` REFERENCES `category` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- country @@ -120,7 +120,7 @@ CREATE TABLE `country` REFERENCES `area` (`id`) ON UPDATE RESTRICT ON DELETE SET NULL -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax @@ -136,7 +136,7 @@ CREATE TABLE `tax` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_rule @@ -151,7 +151,7 @@ CREATE TABLE `tax_rule` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_rule_country @@ -187,7 +187,7 @@ CREATE TABLE `tax_rule_country` REFERENCES `country` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature @@ -203,7 +203,7 @@ CREATE TABLE `feature` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_av @@ -225,7 +225,7 @@ CREATE TABLE `feature_av` REFERENCES `feature` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_product @@ -263,7 +263,7 @@ CREATE TABLE `feature_product` REFERENCES `feature_av` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_template @@ -291,7 +291,7 @@ CREATE TABLE `feature_template` CONSTRAINT `fk_feature_template` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute @@ -306,7 +306,7 @@ CREATE TABLE `attribute` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_av @@ -328,7 +328,7 @@ CREATE TABLE `attribute_av` REFERENCES `attribute` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_combination @@ -362,7 +362,7 @@ CREATE TABLE `attribute_combination` REFERENCES `product_sale_elements` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_sale_elements @@ -392,7 +392,7 @@ CREATE TABLE `product_sale_elements` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_template @@ -419,7 +419,7 @@ CREATE TABLE `attribute_template` CONSTRAINT `fk_attribute_template` FOREIGN KEY (`template_id`) REFERENCES `template` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- config @@ -438,7 +438,7 @@ CREATE TABLE `config` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- customer @@ -472,7 +472,7 @@ CREATE TABLE `customer` REFERENCES `customer_title` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- address @@ -519,7 +519,7 @@ CREATE TABLE `address` REFERENCES `country` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- customer_title @@ -535,7 +535,7 @@ CREATE TABLE `customer_title` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- lang @@ -562,7 +562,7 @@ CREATE TABLE `lang` `updated_at` DATETIME, PRIMARY KEY (`id`), INDEX `idx_lang_by_default` (`by_default`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder @@ -582,7 +582,7 @@ CREATE TABLE `folder` `version_created_at` DATETIME, `version_created_by` VARCHAR(100), PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content @@ -601,7 +601,7 @@ CREATE TABLE `content` `version_created_at` DATETIME, `version_created_by` VARCHAR(100), PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_image @@ -625,7 +625,7 @@ CREATE TABLE `product_image` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_document @@ -648,7 +648,7 @@ CREATE TABLE `product_document` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order @@ -730,7 +730,7 @@ CREATE TABLE `order` REFERENCES `lang` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- currency @@ -751,7 +751,7 @@ CREATE TABLE `currency` PRIMARY KEY (`id`), INDEX `idx_currency_by_default` (`by_default`), INDEX `idx_currency_code` (`code`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_address @@ -776,8 +776,8 @@ CREATE TABLE `order_address` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), - INDEX `FI_order_address_customer_title_id` (`customer_title_id`), - INDEX `FI_order_address_country_id` (`country_id`), + INDEX `fk_order_address_customer_title_id_idx` (`customer_title_id`), + INDEX `fk_order_address_country_id_idx` (`country_id`), CONSTRAINT `fk_order_address_customer_title_id` FOREIGN KEY (`customer_title_id`) REFERENCES `customer_title` (`id`) @@ -788,7 +788,7 @@ CREATE TABLE `order_address` REFERENCES `country` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_product @@ -825,7 +825,7 @@ CREATE TABLE `order_product` REFERENCES `order` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_status @@ -841,7 +841,7 @@ CREATE TABLE `order_status` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `code_UNIQUE` (`code`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_product_attribute_combination @@ -870,7 +870,7 @@ CREATE TABLE `order_product_attribute_combination` REFERENCES `order_product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- module @@ -891,7 +891,7 @@ CREATE TABLE `module` PRIMARY KEY (`id`), UNIQUE INDEX `code_UNIQUE` (`code`), INDEX `idx_module_activate` (`activate`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- accessory @@ -920,7 +920,7 @@ CREATE TABLE `accessory` REFERENCES `product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- area @@ -936,7 +936,7 @@ CREATE TABLE `area` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- area_delivery_module @@ -965,7 +965,7 @@ CREATE TABLE `area_delivery_module` REFERENCES `module` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- profile @@ -981,7 +981,7 @@ CREATE TABLE `profile` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `code_UNIQUE` (`code`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- resource @@ -997,7 +997,7 @@ CREATE TABLE `resource` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `code_UNIQUE` (`code`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- admin @@ -1028,7 +1028,7 @@ CREATE TABLE `admin` REFERENCES `profile` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- profile_resource @@ -1056,7 +1056,7 @@ CREATE TABLE `profile_resource` REFERENCES `resource` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- profile_module @@ -1084,7 +1084,7 @@ CREATE TABLE `profile_module` REFERENCES `module` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- message @@ -1108,7 +1108,7 @@ CREATE TABLE `message` `version_created_by` VARCHAR(100), PRIMARY KEY (`id`), UNIQUE INDEX `name_UNIQUE` (`name`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon @@ -1146,7 +1146,7 @@ CREATE TABLE `coupon` INDEX `idx_is_removing_postage` (`is_removing_postage`), INDEX `idx_max_usage` (`max_usage`), INDEX `idx_is_available_on_special_offers` (`is_available_on_special_offers`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- admin_log @@ -1167,7 +1167,7 @@ CREATE TABLE `admin_log` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_folder @@ -1196,7 +1196,7 @@ CREATE TABLE `content_folder` REFERENCES `folder` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- cart @@ -1241,7 +1241,7 @@ CREATE TABLE `cart` REFERENCES `currency` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- cart_item @@ -1281,7 +1281,7 @@ CREATE TABLE `cart_item` REFERENCES `product_sale_elements` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_price @@ -1309,7 +1309,7 @@ CREATE TABLE `product_price` FOREIGN KEY (`currency_id`) REFERENCES `currency` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_image @@ -1333,7 +1333,7 @@ CREATE TABLE `category_image` REFERENCES `category` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_image @@ -1357,7 +1357,7 @@ CREATE TABLE `folder_image` REFERENCES `folder` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_image @@ -1381,7 +1381,7 @@ CREATE TABLE `content_image` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_document @@ -1404,7 +1404,7 @@ CREATE TABLE `category_document` REFERENCES `category` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_document @@ -1427,7 +1427,7 @@ CREATE TABLE `content_document` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_document @@ -1450,7 +1450,7 @@ CREATE TABLE `folder_document` REFERENCES `folder` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_associated_content @@ -1479,7 +1479,7 @@ CREATE TABLE `product_associated_content` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_associated_content @@ -1508,7 +1508,7 @@ CREATE TABLE `category_associated_content` REFERENCES `content` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- rewriting_url @@ -1534,7 +1534,7 @@ CREATE TABLE `rewriting_url` REFERENCES `rewriting_url` (`id`) ON UPDATE RESTRICT ON DELETE RESTRICT -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- rewriting_argument @@ -1556,7 +1556,7 @@ CREATE TABLE `rewriting_argument` REFERENCES `rewriting_url` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- template @@ -1570,7 +1570,7 @@ CREATE TABLE `template` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- module_image @@ -1594,7 +1594,7 @@ CREATE TABLE `module_image` REFERENCES `module` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_product_tax @@ -1619,7 +1619,7 @@ CREATE TABLE `order_product_tax` REFERENCES `order_product` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- newsletter @@ -1638,7 +1638,7 @@ CREATE TABLE `newsletter` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `email_UNIQUE` (`email`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_coupon @@ -1671,7 +1671,7 @@ CREATE TABLE `order_coupon` REFERENCES `order` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_country @@ -1693,7 +1693,7 @@ CREATE TABLE `coupon_country` FOREIGN KEY (`coupon_id`) REFERENCES `coupon` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_module @@ -1715,7 +1715,7 @@ CREATE TABLE `coupon_module` FOREIGN KEY (`module_id`) REFERENCES `module` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_coupon_country @@ -1736,7 +1736,7 @@ CREATE TABLE `order_coupon_country` CONSTRAINT `fk_order_coupon_country_coupon_id` FOREIGN KEY (`coupon_id`) REFERENCES `order_coupon` (`id`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_coupon_module @@ -1758,7 +1758,7 @@ CREATE TABLE `order_coupon_module` FOREIGN KEY (`module_id`) REFERENCES `module` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_customer_count @@ -1783,7 +1783,7 @@ CREATE TABLE `coupon_customer_count` REFERENCES `coupon` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- brand @@ -1806,7 +1806,7 @@ CREATE TABLE `brand` REFERENCES `brand_image` (`id`) ON UPDATE RESTRICT ON DELETE SET NULL -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- brand_document @@ -1829,7 +1829,7 @@ CREATE TABLE `brand_document` REFERENCES `brand` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- brand_image @@ -1852,7 +1852,7 @@ CREATE TABLE `brand_image` REFERENCES `brand` (`id`) ON UPDATE RESTRICT ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- form_firewall @@ -1871,24 +1871,7 @@ CREATE TABLE `form_firewall` PRIMARY KEY (`id`), INDEX `idx_form_firewall_form_name` (`form_name`), INDEX `idx_form_firewall_ip_address` (`ip_address`) -) ENGINE=InnoDB; - --- --------------------------------------------------------------------- --- import_category --- --------------------------------------------------------------------- - -DROP TABLE IF EXISTS `import_category`; - -CREATE TABLE `import_category` -( - `id` INTEGER NOT NULL AUTO_INCREMENT, - `ref` VARCHAR(255) NOT NULL, - `position` INTEGER NOT NULL, - `created_at` DATETIME, - `updated_at` DATETIME, - PRIMARY KEY (`id`), - UNIQUE INDEX `ref_UNIQUE` (`ref`) -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- export_category @@ -1905,32 +1888,7 @@ CREATE TABLE `export_category` `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `ref_UNIQUE` (`ref`) -) ENGINE=InnoDB; - --- --------------------------------------------------------------------- --- import --- --------------------------------------------------------------------- - -DROP TABLE IF EXISTS `import`; - -CREATE TABLE `import` -( - `id` INTEGER NOT NULL AUTO_INCREMENT, - `ref` VARCHAR(255) NOT NULL, - `import_category_id` INTEGER NOT NULL, - `position` INTEGER NOT NULL, - `handle_class` LONGTEXT NOT NULL, - `created_at` DATETIME, - `updated_at` DATETIME, - PRIMARY KEY (`id`), - UNIQUE INDEX `ref_UNIQUE` (`ref`), - INDEX `idx_import_import_category_id` (`import_category_id`), - CONSTRAINT `fk_import_import_category_id` - FOREIGN KEY (`import_category_id`) - REFERENCES `import_category` (`id`) - ON UPDATE RESTRICT - ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- export @@ -1942,20 +1900,58 @@ CREATE TABLE `export` ( `id` INTEGER NOT NULL AUTO_INCREMENT, `ref` VARCHAR(255) NOT NULL, - `export_category_id` INTEGER NOT NULL, `position` INTEGER NOT NULL, - `handle_class` LONGTEXT NOT NULL, + `export_category_id` INTEGER NOT NULL, + `handle_class` TEXT NOT NULL, `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), UNIQUE INDEX `ref_UNIQUE` (`ref`), - INDEX `idx_export_export_category_id` (`export_category_id`), + INDEX `fk_export_1_idx` (`export_category_id`), CONSTRAINT `fk_export_export_category_id` FOREIGN KEY (`export_category_id`) REFERENCES `export_category` (`id`) - ON UPDATE RESTRICT - ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; + +-- --------------------------------------------------------------------- +-- import_category +-- --------------------------------------------------------------------- + +DROP TABLE IF EXISTS `import_category`; + +CREATE TABLE `import_category` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `ref` VARCHAR(255) NOT NULL, + `position` INTEGER NOT NULL, + `created_at` DATETIME, + `updated_at` DATETIME, + PRIMARY KEY (`id`), + UNIQUE INDEX `ref_UNIQUE` (`ref`) +) ENGINE=InnoDB CHARACTER SET='utf8'; + +-- --------------------------------------------------------------------- +-- import +-- --------------------------------------------------------------------- + +DROP TABLE IF EXISTS `import`; + +CREATE TABLE `import` +( + `id` INTEGER NOT NULL AUTO_INCREMENT, + `ref` VARCHAR(255) NOT NULL, + `position` INTEGER NOT NULL, + `import_category_id` INTEGER NOT NULL, + `handle_class` TEXT NOT NULL, + `created_at` DATETIME, + `updated_at` DATETIME, + PRIMARY KEY (`id`), + UNIQUE INDEX `ref_UNIQUE` (`ref`), + INDEX `fk_export_1_idx` (`import_category_id`), + CONSTRAINT `fk_import_import_category_id` + FOREIGN KEY (`import_category_id`) + REFERENCES `import_category` (`id`) +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_i18n @@ -1979,7 +1975,7 @@ CREATE TABLE `category_i18n` FOREIGN KEY (`id`) REFERENCES `category` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_i18n @@ -2003,7 +1999,7 @@ CREATE TABLE `product_i18n` FOREIGN KEY (`id`) REFERENCES `product` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- country_i18n @@ -2024,7 +2020,7 @@ CREATE TABLE `country_i18n` FOREIGN KEY (`id`) REFERENCES `country` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_i18n @@ -2043,7 +2039,7 @@ CREATE TABLE `tax_i18n` FOREIGN KEY (`id`) REFERENCES `tax` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- tax_rule_i18n @@ -2062,7 +2058,7 @@ CREATE TABLE `tax_rule_i18n` FOREIGN KEY (`id`) REFERENCES `tax_rule` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_i18n @@ -2083,7 +2079,7 @@ CREATE TABLE `feature_i18n` FOREIGN KEY (`id`) REFERENCES `feature` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- feature_av_i18n @@ -2104,7 +2100,7 @@ CREATE TABLE `feature_av_i18n` FOREIGN KEY (`id`) REFERENCES `feature_av` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_i18n @@ -2125,7 +2121,7 @@ CREATE TABLE `attribute_i18n` FOREIGN KEY (`id`) REFERENCES `attribute` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- attribute_av_i18n @@ -2146,7 +2142,7 @@ CREATE TABLE `attribute_av_i18n` FOREIGN KEY (`id`) REFERENCES `attribute_av` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- config_i18n @@ -2167,7 +2163,7 @@ CREATE TABLE `config_i18n` FOREIGN KEY (`id`) REFERENCES `config` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- customer_title_i18n @@ -2186,7 +2182,7 @@ CREATE TABLE `customer_title_i18n` FOREIGN KEY (`id`) REFERENCES `customer_title` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_i18n @@ -2210,7 +2206,7 @@ CREATE TABLE `folder_i18n` FOREIGN KEY (`id`) REFERENCES `folder` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_i18n @@ -2234,7 +2230,7 @@ CREATE TABLE `content_i18n` FOREIGN KEY (`id`) REFERENCES `content` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_image_i18n @@ -2255,7 +2251,7 @@ CREATE TABLE `product_image_i18n` FOREIGN KEY (`id`) REFERENCES `product_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_document_i18n @@ -2276,7 +2272,7 @@ CREATE TABLE `product_document_i18n` FOREIGN KEY (`id`) REFERENCES `product_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- currency_i18n @@ -2294,7 +2290,7 @@ CREATE TABLE `currency_i18n` FOREIGN KEY (`id`) REFERENCES `currency` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_status_i18n @@ -2315,7 +2311,7 @@ CREATE TABLE `order_status_i18n` FOREIGN KEY (`id`) REFERENCES `order_status` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- module_i18n @@ -2336,7 +2332,7 @@ CREATE TABLE `module_i18n` FOREIGN KEY (`id`) REFERENCES `module` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- profile_i18n @@ -2357,7 +2353,7 @@ CREATE TABLE `profile_i18n` FOREIGN KEY (`id`) REFERENCES `profile` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- resource_i18n @@ -2378,7 +2374,7 @@ CREATE TABLE `resource_i18n` FOREIGN KEY (`id`) REFERENCES `resource` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- message_i18n @@ -2399,7 +2395,7 @@ CREATE TABLE `message_i18n` FOREIGN KEY (`id`) REFERENCES `message` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_i18n @@ -2419,7 +2415,7 @@ CREATE TABLE `coupon_i18n` FOREIGN KEY (`id`) REFERENCES `coupon` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_image_i18n @@ -2440,7 +2436,7 @@ CREATE TABLE `category_image_i18n` FOREIGN KEY (`id`) REFERENCES `category_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_image_i18n @@ -2461,7 +2457,7 @@ CREATE TABLE `folder_image_i18n` FOREIGN KEY (`id`) REFERENCES `folder_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_image_i18n @@ -2482,7 +2478,7 @@ CREATE TABLE `content_image_i18n` FOREIGN KEY (`id`) REFERENCES `content_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_document_i18n @@ -2503,7 +2499,7 @@ CREATE TABLE `category_document_i18n` FOREIGN KEY (`id`) REFERENCES `category_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_document_i18n @@ -2524,7 +2520,7 @@ CREATE TABLE `content_document_i18n` FOREIGN KEY (`id`) REFERENCES `content_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_document_i18n @@ -2545,7 +2541,7 @@ CREATE TABLE `folder_document_i18n` FOREIGN KEY (`id`) REFERENCES `folder_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- template_i18n @@ -2563,7 +2559,7 @@ CREATE TABLE `template_i18n` FOREIGN KEY (`id`) REFERENCES `template` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- module_image_i18n @@ -2584,7 +2580,7 @@ CREATE TABLE `module_image_i18n` FOREIGN KEY (`id`) REFERENCES `module_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- brand_i18n @@ -2608,7 +2604,7 @@ CREATE TABLE `brand_i18n` FOREIGN KEY (`id`) REFERENCES `brand` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- brand_document_i18n @@ -2629,7 +2625,7 @@ CREATE TABLE `brand_document_i18n` FOREIGN KEY (`id`) REFERENCES `brand_document` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- brand_image_i18n @@ -2650,25 +2646,7 @@ CREATE TABLE `brand_image_i18n` FOREIGN KEY (`id`) REFERENCES `brand_image` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; - --- --------------------------------------------------------------------- --- import_category_i18n --- --------------------------------------------------------------------- - -DROP TABLE IF EXISTS `import_category_i18n`; - -CREATE TABLE `import_category_i18n` -( - `id` INTEGER NOT NULL, - `locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL, - `title` VARCHAR(255) NOT NULL, - PRIMARY KEY (`id`,`locale`), - CONSTRAINT `import_category_i18n_FK_1` - FOREIGN KEY (`id`) - REFERENCES `import_category` (`id`) - ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- export_category_i18n @@ -2686,26 +2664,7 @@ CREATE TABLE `export_category_i18n` FOREIGN KEY (`id`) REFERENCES `export_category` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; - --- --------------------------------------------------------------------- --- import_i18n --- --------------------------------------------------------------------- - -DROP TABLE IF EXISTS `import_i18n`; - -CREATE TABLE `import_i18n` -( - `id` INTEGER NOT NULL, - `locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL, - `title` VARCHAR(255) NOT NULL, - `description` LONGTEXT, - PRIMARY KEY (`id`,`locale`), - CONSTRAINT `import_i18n_FK_1` - FOREIGN KEY (`id`) - REFERENCES `import` (`id`) - ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- export_i18n @@ -2718,13 +2677,50 @@ CREATE TABLE `export_i18n` `id` INTEGER NOT NULL, `locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL, `title` VARCHAR(255) NOT NULL, - `description` LONGTEXT, + `description` TEXT, PRIMARY KEY (`id`,`locale`), CONSTRAINT `export_i18n_FK_1` FOREIGN KEY (`id`) REFERENCES `export` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; + +-- --------------------------------------------------------------------- +-- import_category_i18n +-- --------------------------------------------------------------------- + +DROP TABLE IF EXISTS `import_category_i18n`; + +CREATE TABLE `import_category_i18n` +( + `id` INTEGER NOT NULL, + `locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL, + `title` VARCHAR(255) NOT NULL, + PRIMARY KEY (`id`,`locale`), + CONSTRAINT `import_category_i18n_FK_1` + FOREIGN KEY (`id`) + REFERENCES `import_category` (`id`) + ON DELETE CASCADE +) ENGINE=InnoDB CHARACTER SET='utf8'; + +-- --------------------------------------------------------------------- +-- import_i18n +-- --------------------------------------------------------------------- + +DROP TABLE IF EXISTS `import_i18n`; + +CREATE TABLE `import_i18n` +( + `id` INTEGER NOT NULL, + `locale` VARCHAR(5) DEFAULT 'en_US' NOT NULL, + `title` VARCHAR(255) NOT NULL, + `description` TEXT, + PRIMARY KEY (`id`,`locale`), + CONSTRAINT `import_i18n_FK_1` + FOREIGN KEY (`id`) + REFERENCES `import` (`id`) + ON DELETE CASCADE +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- category_version @@ -2748,7 +2744,7 @@ CREATE TABLE `category_version` FOREIGN KEY (`id`) REFERENCES `category` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- product_version @@ -2775,7 +2771,7 @@ CREATE TABLE `product_version` FOREIGN KEY (`id`) REFERENCES `product` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- folder_version @@ -2799,7 +2795,7 @@ CREATE TABLE `folder_version` FOREIGN KEY (`id`) REFERENCES `folder` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- content_version @@ -2822,7 +2818,7 @@ CREATE TABLE `content_version` FOREIGN KEY (`id`) REFERENCES `content` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- order_version @@ -2859,7 +2855,7 @@ CREATE TABLE `order_version` FOREIGN KEY (`id`) REFERENCES `order` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- message_version @@ -2886,7 +2882,7 @@ CREATE TABLE `message_version` FOREIGN KEY (`id`) REFERENCES `message` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; -- --------------------------------------------------------------------- -- coupon_version @@ -2919,7 +2915,7 @@ CREATE TABLE `coupon_version` FOREIGN KEY (`id`) REFERENCES `coupon` (`id`) ON DELETE CASCADE -) ENGINE=InnoDB; +) ENGINE=InnoDB CHARACTER SET='utf8'; # This restores the fkey checks, after having unset them earlier SET FOREIGN_KEY_CHECKS = 1; diff --git a/setup/update/2.0.3-beta2.sql b/setup/update/2.0.3-beta2.sql new file mode 100644 index 000000000..8252d4adc --- /dev/null +++ b/setup/update/2.0.3-beta2.sql @@ -0,0 +1,6 @@ +SET FOREIGN_KEY_CHECKS = 0; + +ALTER TABLE `export` ADD INDEX `fk_export_1_idx` (`export_category_id`); +ALTER TABLE `import` ADD INDEX `fk_import_1_idx` (`import_category_id`); + +SET FOREIGN_KEY_CHECKS = 1; \ No newline at end of file