Skip to content

Commit 03da56e

Browse files
SolsWebdesignlazyguru
authored andcommitted
Bill-to Name and Ship-to Name trancated to 20 characters in backend Compared the lengths of firstname, middlename and lastname of table "quote_address" with those of "quote" (255, 40 and 255 resp.) and of "sales_order_address" (255, 255 and 255) and with sales_order (128, 128 and 128) and choose to go with 255, 40 and 255 since these are used in "quote" as well and these are the values I know from Magento 1.9 as well. The other values are a bit inconsistent. Tested. Updated setup version of the Quote module to 2.0.5, moved all updates into a single if statement.
1 parent 7b7b9ff commit 03da56e

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

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

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,16 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
4646
]
4747
);
4848
}
49-
50-
if (version_compare($context->getVersion(), '2.0.2', '<')) {
49+
//drop foreign key for single DB case
50+
if (version_compare($context->getVersion(), '2.0.3', '<')
51+
&& $setup->tableExists($setup->getTable('quote_item'))
52+
) {
53+
$setup->getConnection()->dropForeignKey(
54+
$setup->getTable('quote_item'),
55+
$setup->getFkName('quote_item', 'product_id', 'catalog_product_entity', 'entity_id')
56+
);
57+
}
58+
if (version_compare($context->getVersion(), '2.0.5', '<')) {
5159
$setup->getConnection(self::$connectionName)->changeColumn(
5260
$setup->getTable('quote_address', self::$connectionName),
5361
'firstname',
@@ -58,8 +66,6 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
5866
'comment' => 'Firstname'
5967
]
6068
);
61-
}
62-
if (version_compare($context->getVersion(), '2.0.2', '<')) {
6369
$setup->getConnection(self::$connectionName)->changeColumn(
6470
$setup->getTable('quote_address', self::$connectionName),
6571
'middlename',
@@ -70,8 +76,6 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
7076
'comment' => 'Middlename'
7177
]
7278
);
73-
}
74-
if (version_compare($context->getVersion(), '2.0.2', '<')) {
7579
$setup->getConnection(self::$connectionName)->changeColumn(
7680
$setup->getTable('quote_address', self::$connectionName),
7781
'lastname',
@@ -83,15 +87,6 @@ public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $con
8387
]
8488
);
8589
}
86-
//drop foreign key for single DB case
87-
if (version_compare($context->getVersion(), '2.0.3', '<')
88-
&& $setup->tableExists($setup->getTable('quote_item'))
89-
) {
90-
$setup->getConnection()->dropForeignKey(
91-
$setup->getTable('quote_item'),
92-
$setup->getFkName('quote_item', 'product_id', 'catalog_product_entity', 'entity_id')
93-
);
94-
}
9590
$setup->endSetup();
9691
}
9792
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
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_Quote" setup_version="2.0.3">
9+
<module name="Magento_Quote" setup_version="2.0.5">
1010
</module>
1111
</config>

0 commit comments

Comments
 (0)