This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace YourNamespace\YourModule\Setup; | |
use Magento\Framework\Setup\ModuleContextInterface; | |
use Magento\Framework\Setup\ModuleDataSetupInterface; | |
use Magento\Framework\Setup\UpgradeDataInterface; | |
class UpgradeData implements UpgradeDataInterface | |
{ | |
/** | |
* {@inheritdoc} | |
*/ | |
public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) | |
{ | |
$setup->startSetup(); | |
if (version_compare($context->getVersion(), '1.0.1', '<')) { | |
$connection = $setup->getConnection(); | |
$grid = $setup->getTable('sales_order_grid'); | |
$affiliate = $setup->getTable('affiliate'); | |
$connection->query( | |
$connection->updateFromSelect( | |
$connection->select() | |
->join( | |
$affiliate, | |
sprintf('%s.entity_id = %s.order_id', $grid, $affiliate), | |
'affiliate_information' | |
), | |
$grid | |
) | |
); | |
} | |
$setup->endSetup(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment