diff --git a/app/code/Magento/Quote/Setup/UpgradeSchema.php b/app/code/Magento/Quote/Setup/UpgradeSchema.php index 95b4771535731..298b80604d31c 100644 --- a/app/code/Magento/Quote/Setup/UpgradeSchema.php +++ b/app/code/Magento/Quote/Setup/UpgradeSchema.php @@ -87,6 +87,23 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con ] ); } + if (version_compare($context->getVersion(), '2.0.5', '<')) { + $this->expandRemoteIpField($setup); + } $setup->endSetup(); } + + /** + * @param SchemaSetupInterface $setup + * @return void + */ + private function expandRemoteIpField(SchemaSetupInterface $setup) + { + $connection = $setup->getConnection(self::$connectionName); + $connection->modifyColumn( + $setup->getTable('quote', self::$connectionName), + 'remote_ip', + ['type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, 'length' => 45] + ); + } } diff --git a/app/code/Magento/Quote/etc/module.xml b/app/code/Magento/Quote/etc/module.xml index 122cd3a287a93..a2ecbdccceeeb 100644 --- a/app/code/Magento/Quote/etc/module.xml +++ b/app/code/Magento/Quote/etc/module.xml @@ -6,6 +6,6 @@ */ --> - + diff --git a/app/code/Magento/Sales/Setup/UpgradeSchema.php b/app/code/Magento/Sales/Setup/UpgradeSchema.php index 28ed0001b2108..2dfa4ed3b3d95 100644 --- a/app/code/Magento/Sales/Setup/UpgradeSchema.php +++ b/app/code/Magento/Sales/Setup/UpgradeSchema.php @@ -69,6 +69,9 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con $this->addColumnBaseGrandTotal($installer); $this->addIndexBaseGrandTotal($installer); } + if (version_compare($context->getVersion(), '2.0.4', '<')) { + $this->expandRemoteIpField($installer); + } } /** @@ -104,4 +107,21 @@ private function addIndexBaseGrandTotal(SchemaSetupInterface $installer) ['base_grand_total'] ); } + + /** + * @param SchemaSetupInterface $installer + * @return void + */ + private function expandRemoteIpField(SchemaSetupInterface $installer) + { + $connection = $installer->getConnection(self::$connectionName); + $connection->modifyColumn( + $installer->getTable('sales_order', self::$connectionName), + 'remote_ip', + [ + 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT, + 'length' => 45 + ] + ); + } } diff --git a/app/code/Magento/Sales/etc/module.xml b/app/code/Magento/Sales/etc/module.xml index 2fbf444f7852d..216422db7b3d4 100644 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -6,7 +6,7 @@ */ --> - +