Skip to content

Commit bd3d976

Browse files
authored
Merge pull request #1089 from magento-okapis/MAGETWO-61509-Schema-Comparison
- MAGETWO-61509: Inconsistent schema versions after upgrade
2 parents 35e2dbb + 0e8020d commit bd3d976

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\NewRelicReporting\Setup;
7+
8+
use Magento\Framework\Setup\ModuleContextInterface;
9+
use Magento\Framework\Setup\SchemaSetupInterface;
10+
use Magento\Framework\Setup\UpgradeSchemaInterface;
11+
12+
/**
13+
* Upgrade the NewRelicReporting module DB scheme
14+
*/
15+
class UpgradeSchema implements UpgradeSchemaInterface
16+
{
17+
/**
18+
* {@inheritdoc}
19+
*/
20+
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
21+
{
22+
$setup->startSetup();
23+
24+
if (version_compare($context->getVersion(), '2.0.1', '<')) {
25+
// The following fields are not 'unsigned' as they should after upgrade from 2.1
26+
$setup->getConnection()->modifyColumn(
27+
$setup->getTable('reporting_orders'),
28+
'total',
29+
['unsigned' => true, 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL]
30+
);
31+
$setup->getConnection()->modifyColumn(
32+
$setup->getTable('reporting_orders'),
33+
'total_base',
34+
['unsigned' => true, 'type' => \Magento\Framework\DB\Ddl\Table::TYPE_DECIMAL]
35+
);
36+
}
37+
38+
$setup->endSetup();
39+
}
40+
}

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

+1-1
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_NewRelicReporting" setup_version="2.0.0">
9+
<module name="Magento_NewRelicReporting" setup_version="2.0.1">
1010
<sequence>
1111
<module name="Magento_Store"/>
1212
<module name="Magento_Customer"/>

0 commit comments

Comments
 (0)