Skip to content

Commit 360dcd5

Browse files
authored
[Tax] add FK to tax/sales_order_tax again (OpenMage#4334)
* add FK to tax/sales_order_tax again * ~ fix codestyle * Update upgrade-1.6.0.4-1.6.0.5.php Use purge option
1 parent 5dbb432 commit 360dcd5

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

app/code/core/Mage/Tax/etc/config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<config>
1818
<modules>
1919
<Mage_Tax>
20-
<version>1.6.0.4</version>
20+
<version>1.6.0.5</version>
2121
</Mage_Tax>
2222
</modules>
2323
<global>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
/**
3+
* OpenMage
4+
*
5+
* This source file is subject to the Open Software License (OSL 3.0)
6+
* that is bundled with this package in the file LICENSE.txt.
7+
* It is also available at https://opensource.org/license/osl-3-0-php
8+
*
9+
* @category Mage
10+
* @package Mage_Tax
11+
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
12+
* @copyright Copyright (c) 2020-2025 The OpenMage Contributors (https://www.openmage.org)
13+
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
14+
*/
15+
16+
/** @var Mage_Tax_Model_Resource_Setup $this */
17+
18+
$this->startSetup();
19+
20+
$taxTable = $this->getTable('tax/sales_order_tax');
21+
$orderTable = $this->getTable('sales/order');
22+
23+
// adds FK_SALES_ORDER_TAX_ORDER back again
24+
$this->getConnection()->addForeignKey(
25+
$this->getFkName($taxTable, 'order_id', $orderTable, 'entity_id'),
26+
$taxTable,
27+
'order_id',
28+
$orderTable,
29+
'entity_id',
30+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE,
31+
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE,
32+
true
33+
);
34+
35+
$this->endSetup();

0 commit comments

Comments
 (0)