Changed product_brand fk
This commit is contained in:
@@ -174,7 +174,7 @@ class BrandTableMap extends TableMap
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('BrandImageRelatedByLogoImageId', '\\Thelia\\Model\\BrandImage', RelationMap::MANY_TO_ONE, array('logo_image_id' => 'id', ), 'SET NULL', 'RESTRICT');
|
||||
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::ONE_TO_MANY, array('id' => 'brand_id', ), 'SET NULL', null, 'Products');
|
||||
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::ONE_TO_MANY, array('id' => 'brand_id', ), 'RESTRICT', 'RESTRICT', 'Products');
|
||||
$this->addRelation('BrandDocument', '\\Thelia\\Model\\BrandDocument', RelationMap::ONE_TO_MANY, array('id' => 'brand_id', ), 'CASCADE', 'RESTRICT', 'BrandDocuments');
|
||||
$this->addRelation('BrandImageRelatedByBrandId', '\\Thelia\\Model\\BrandImage', RelationMap::ONE_TO_MANY, array('id' => 'brand_id', ), 'CASCADE', 'RESTRICT', 'BrandImagesRelatedByBrandId');
|
||||
$this->addRelation('BrandI18n', '\\Thelia\\Model\\BrandI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'BrandI18ns');
|
||||
@@ -200,7 +200,6 @@ class BrandTableMap 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.
|
||||
ProductTableMap::clearInstancePool();
|
||||
BrandDocumentTableMap::clearInstancePool();
|
||||
BrandImageTableMap::clearInstancePool();
|
||||
BrandI18nTableMap::clearInstancePool();
|
||||
|
||||
@@ -210,8 +210,8 @@ class ProductTableMap extends TableMap
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('TaxRule', '\\Thelia\\Model\\TaxRule', RelationMap::MANY_TO_ONE, array('tax_rule_id' => 'id', ), 'RESTRICT', 'RESTRICT');
|
||||
$this->addRelation('Template', '\\Thelia\\Model\\Template', RelationMap::MANY_TO_ONE, array('template_id' => 'id', ), null, null);
|
||||
$this->addRelation('Brand', '\\Thelia\\Model\\Brand', RelationMap::MANY_TO_ONE, array('brand_id' => 'id', ), 'SET NULL', null);
|
||||
$this->addRelation('Template', '\\Thelia\\Model\\Template', RelationMap::MANY_TO_ONE, array('template_id' => 'id', ), 'SET NULL', null);
|
||||
$this->addRelation('Brand', '\\Thelia\\Model\\Brand', RelationMap::MANY_TO_ONE, array('brand_id' => 'id', ), 'RESTRICT', 'RESTRICT');
|
||||
$this->addRelation('ProductCategory', '\\Thelia\\Model\\ProductCategory', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductCategories');
|
||||
$this->addRelation('FeatureProduct', '\\Thelia\\Model\\FeatureProduct', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'FeatureProducts');
|
||||
$this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::ONE_TO_MANY, array('id' => 'product_id', ), 'CASCADE', 'RESTRICT', 'ProductSaleElementss');
|
||||
|
||||
@@ -155,7 +155,7 @@ class TemplateTableMap extends TableMap
|
||||
*/
|
||||
public function buildRelations()
|
||||
{
|
||||
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::ONE_TO_MANY, array('id' => 'template_id', ), null, null, 'Products');
|
||||
$this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::ONE_TO_MANY, array('id' => 'template_id', ), 'SET NULL', null, 'Products');
|
||||
$this->addRelation('FeatureTemplate', '\\Thelia\\Model\\FeatureTemplate', RelationMap::ONE_TO_MANY, array('id' => 'template_id', ), null, null, 'FeatureTemplates');
|
||||
$this->addRelation('AttributeTemplate', '\\Thelia\\Model\\AttributeTemplate', RelationMap::ONE_TO_MANY, array('id' => 'template_id', ), null, null, 'AttributeTemplates');
|
||||
$this->addRelation('TemplateI18n', '\\Thelia\\Model\\TemplateI18n', RelationMap::ONE_TO_MANY, array('id' => 'id', ), 'CASCADE', null, 'TemplateI18ns');
|
||||
@@ -183,6 +183,7 @@ class TemplateTableMap 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.
|
||||
ProductTableMap::clearInstancePool();
|
||||
TemplateI18nTableMap::clearInstancePool();
|
||||
}
|
||||
|
||||
|
||||
@@ -46,10 +46,10 @@
|
||||
<column name="meta_keywords" type="LONGVARCHAR" />
|
||||
<foreign-key foreignTable="tax_rule" name="fk_product_tax_rule_id" onDelete="RESTRICT" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="tax_rule_id" />
|
||||
</foreign-key>
|
||||
</foreign-key>
|
||||
<foreign-key foreignTable="template" name="fk_product_template" onDelete="SET NULL">
|
||||
<reference foreign="id" local="template_id" />
|
||||
</foreign-key>
|
||||
</foreign-key>
|
||||
<foreign-key foreignTable="brand" name="fk_product_brand" onDelete="RESTRICT" onUpdate="RESTRICT">
|
||||
<reference foreign="id" local="brand_id" />
|
||||
</foreign-key>
|
||||
|
||||
@@ -57,11 +57,13 @@ CREATE TABLE `product`
|
||||
ON DELETE RESTRICT,
|
||||
CONSTRAINT `fk_product_template`
|
||||
FOREIGN KEY (`template_id`)
|
||||
REFERENCES `template` (`id`),
|
||||
REFERENCES `template` (`id`)
|
||||
ON DELETE SET NULL,
|
||||
CONSTRAINT `fk_product_brand`
|
||||
FOREIGN KEY (`brand_id`)
|
||||
REFERENCES `brand` (`id`)
|
||||
ON DELETE SET NULL
|
||||
ON UPDATE RESTRICT
|
||||
ON DELETE RESTRICT
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user