Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $installer = $setup;
- $installer->startSetup();
- $installer->getConnection()->addColumn(
- $installer->getTable('sales_order_grid'),
- 'billing_company',
- [
- 'type' => Table::TYPE_TEXT,
- 'nullable' => true,
- 'comment' => 'Company Name',
- ]
- );
- $setup->endSetup();
- public function __construct()
- {
- }
- 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');
- $source = $setup->getTable('customer_grid_flat');
- $connection->query(
- $connection->updateFromSelect(
- $connection->select()
- ->join(
- $source,
- sprintf('%s.customer_id = %s.entity_id', $grid, $source),
- 'billing_company'
- ),
- $grid
- )
- );
- }
- $setup->endSetup();
- }
Add Comment
Please, Sign In to add comment