Skip to content

Commit

Permalink
Virtual Categories and Search Terms products position : adding missin…
Browse files Browse the repository at this point in the history
…g foreign keys to catalog_product_entity
  • Loading branch information
romainruaud authored and Aurélien FOUCRET committed Feb 10, 2016
1 parent 7c1fbb4 commit 85b00a1
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/code/community/Smile/ElasticSearch/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<config>
<modules>
<Smile_ElasticSearch>
<version>1.2.1</version>
<version>1.2.2</version>
</Smile_ElasticSearch>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Append Missing foreign key to catalog_product_entity on search terms product positions
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile Searchandising Suite to newer
* versions in the future.
*
* @category Smile
* @package Smile_ElasticSearch
* @author Romain Ruaud <[email protected]>
* @copyright 2016 Smile
* @license Apache License Version 2.0
*/
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;

$installer->startSetup();

$tableName = $installer->getTable('smile_elasticsearch/search_term_product_position');

$installer->getConnection()->addForeignKey(
$installer->getFkName(
'smile_elasticsearch/search_term_product_position',
'product_id',
'catalog/product',
'entity_id'
),
$tableName,
'product_id',
$installer->getTable('catalog/product'),
'entity_id',
Varien_Db_Ddl_Table::ACTION_CASCADE,
Varien_Db_Ddl_Table::ACTION_CASCADE
);

$installer->endSetup();
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<config>
<modules>
<Smile_VirtualCategories>
<version>1.0.2</version>
<version>1.0.3</version>
</Smile_VirtualCategories>
</modules>
<global>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* Append Missing foreign key to catalog_product_entity on virtual categories product positions
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade Smile Searchandising Suite to newer
* versions in the future.
*
* @category Smile
* @package Smile_VirtualCategories
* @author Romain Ruaud <[email protected]>
* @copyright 2016 Smile
* @license Apache License Version 2.0
*/
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;

$installer->startSetup();

$tableName = $installer->getTable('smile_virtualcategories/category_product_position');

$installer->getConnection()->addForeignKey(
$installer->getFkName(
'smile_virtualcategories/category_product_position',
'product_id',
'catalog/product',
'entity_id'
),
$tableName,
'product_id',
$installer->getTable('catalog/product'),
'entity_id',
Varien_Db_Ddl_Table::ACTION_CASCADE,
Varien_Db_Ddl_Table::ACTION_CASCADE
);

$installer->endSetup();

0 comments on commit 85b00a1

Please sign in to comment.