Skip to content

Commit dd753a1

Browse files
committed
18615 - change structure for last trans id in sales_order_payment
Moved to upgrade schema and bumped module version
1 parent 6d33140 commit dd753a1

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

app/code/Magento/Sales/Setup/UpgradeSchema.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
109109
if (version_compare($context->getVersion(), '2.0.10', '<')) {
110110
$this->expandRemoteIpField($installer);
111111
}
112+
if (version_compare($context->getVersion(), '2.0.11', '<')) {
113+
$this->expandLastTransIdField($installer);
114+
}
112115
}
113116

114117
/**
@@ -161,4 +164,21 @@ private function expandRemoteIpField(SchemaSetupInterface $installer)
161164
]
162165
);
163166
}
167+
168+
/**
169+
* @param SchemaSetupInterface $installer
170+
* @return void
171+
*/
172+
private function expandLastTransIdField(SchemaSetupInterface $installer)
173+
{
174+
$connection = $installer->getConnection(self::$connectionName);
175+
$connection->modifyColumn(
176+
$installer->getTable('sales_order_payment', self::$connectionName),
177+
'last_trans_id',
178+
[
179+
'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
180+
'length' => 255
181+
]
182+
);
183+
}
164184
}

app/code/Magento/Sales/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
9-
<module name="Magento_Sales" setup_version="2.0.10">
9+
<module name="Magento_Sales" setup_version="2.0.11">
1010
<sequence>
1111
<module name="Magento_Rule"/>
1212
<module name="Magento_Catalog"/>

0 commit comments

Comments
 (0)