Skip to content

Commit 85b00a1

Browse files
romainruaudAurélien FOUCRET
authored andcommitted
Virtual Categories and Search Terms products position : adding missing foreign keys to catalog_product_entity
1 parent 7c1fbb4 commit 85b00a1

File tree

4 files changed

+78
-2
lines changed

4 files changed

+78
-2
lines changed

src/app/code/community/Smile/ElasticSearch/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<config>
2222
<modules>
2323
<Smile_ElasticSearch>
24-
<version>1.2.1</version>
24+
<version>1.2.2</version>
2525
</Smile_ElasticSearch>
2626
</modules>
2727
<global>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* Append Missing foreign key to catalog_product_entity on search terms product positions
4+
*
5+
* DISCLAIMER
6+
*
7+
* Do not edit or add to this file if you wish to upgrade Smile Searchandising Suite to newer
8+
* versions in the future.
9+
*
10+
* @category Smile
11+
* @package Smile_ElasticSearch
12+
* @author Romain Ruaud <[email protected]>
13+
* @copyright 2016 Smile
14+
* @license Apache License Version 2.0
15+
*/
16+
/* @var $installer Mage_Core_Model_Resource_Setup */
17+
$installer = $this;
18+
19+
$installer->startSetup();
20+
21+
$tableName = $installer->getTable('smile_elasticsearch/search_term_product_position');
22+
23+
$installer->getConnection()->addForeignKey(
24+
$installer->getFkName(
25+
'smile_elasticsearch/search_term_product_position',
26+
'product_id',
27+
'catalog/product',
28+
'entity_id'
29+
),
30+
$tableName,
31+
'product_id',
32+
$installer->getTable('catalog/product'),
33+
'entity_id',
34+
Varien_Db_Ddl_Table::ACTION_CASCADE,
35+
Varien_Db_Ddl_Table::ACTION_CASCADE
36+
);
37+
38+
$installer->endSetup();

src/app/code/community/Smile/VirtualCategories/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<config>
2222
<modules>
2323
<Smile_VirtualCategories>
24-
<version>1.0.2</version>
24+
<version>1.0.3</version>
2525
</Smile_VirtualCategories>
2626
</modules>
2727
<global>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?php
2+
/**
3+
* Append Missing foreign key to catalog_product_entity on virtual categories product positions
4+
*
5+
* DISCLAIMER
6+
*
7+
* Do not edit or add to this file if you wish to upgrade Smile Searchandising Suite to newer
8+
* versions in the future.
9+
*
10+
* @category Smile
11+
* @package Smile_VirtualCategories
12+
* @author Romain Ruaud <[email protected]>
13+
* @copyright 2016 Smile
14+
* @license Apache License Version 2.0
15+
*/
16+
/* @var $installer Mage_Core_Model_Resource_Setup */
17+
$installer = $this;
18+
19+
$installer->startSetup();
20+
21+
$tableName = $installer->getTable('smile_virtualcategories/category_product_position');
22+
23+
$installer->getConnection()->addForeignKey(
24+
$installer->getFkName(
25+
'smile_virtualcategories/category_product_position',
26+
'product_id',
27+
'catalog/product',
28+
'entity_id'
29+
),
30+
$tableName,
31+
'product_id',
32+
$installer->getTable('catalog/product'),
33+
'entity_id',
34+
Varien_Db_Ddl_Table::ACTION_CASCADE,
35+
Varien_Db_Ddl_Table::ACTION_CASCADE
36+
);
37+
38+
$installer->endSetup();

0 commit comments

Comments
 (0)