Skip to content
Snippets Groups Projects
Unverified Commit bf6a8ca6 authored by Ievgen Shakhsuvarov's avatar Ievgen Shakhsuvarov
Browse files

Fix vault_payment_token install script type where column defaults were not set

 - UpgradeSchema script added
parent eda05cf2
Branches
No related merge requests found
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Vault\Setup;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\UpgradeSchemaInterface;
use Magento\Framework\DB\Ddl\Table;
/**
* Upgrade the Vault module DB scheme
*/
class UpgradeSchema implements UpgradeSchemaInterface
{
/**
* @inheritdoc
*/
public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
if (version_compare($context->getVersion(), '2.0.3', '<')) {
$this->upgradeTokenTableDefaultValues($setup);
}
$setup->endSetup();
}
/**
* @param SchemaSetupInterface $setup
* @return void
*/
private function upgradeTokenTableDefaultValues(SchemaSetupInterface $setup)
{
$columns = ['is_active', 'is_visible'];
foreach ($columns as $columnName) {
$setup->getConnection()->modifyColumn(
$setup->getTable(InstallSchema::PAYMENT_TOKEN_TABLE),
$columnName,
[
'type' => Table::TYPE_BOOLEAN,
'nullable' => false,
'default' => '1'
]
);
}
}
}
......@@ -6,7 +6,7 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_Vault" setup_version="2.0.2">
<module name="Magento_Vault" setup_version="2.0.3">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Store"/>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment