diff --git a/app/code/Magento/Vault/Setup/InstallSchema.php b/app/code/Magento/Vault/Setup/InstallSchema.php index 32e1d62754439..dd65f7a8c9772 100644 --- a/app/code/Magento/Vault/Setup/InstallSchema.php +++ b/app/code/Magento/Vault/Setup/InstallSchema.php @@ -90,13 +90,13 @@ public function install(SchemaSetupInterface $setup, ModuleContextInterface $con 'is_active', Table::TYPE_BOOLEAN, null, - ['nullable' => false, 'dafault' => true], + ['nullable' => false, 'default' => true], 'Is active flag' )->addColumn( 'is_visible', Table::TYPE_BOOLEAN, null, - ['nullable' => false, 'dafault' => true], + ['nullable' => false, 'default' => true], 'Is visible flag' )->addIndex( $setup->getIdxName( diff --git a/app/code/Magento/Vault/Setup/UpgradeSchema.php b/app/code/Magento/Vault/Setup/UpgradeSchema.php new file mode 100644 index 0000000000000..643bd1751f668 --- /dev/null +++ b/app/code/Magento/Vault/Setup/UpgradeSchema.php @@ -0,0 +1,51 @@ +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' + ] + ); + } + } +} diff --git a/app/code/Magento/Vault/etc/module.xml b/app/code/Magento/Vault/etc/module.xml index 1a7d1fe7d09fd..253e7f13aaadc 100644 --- a/app/code/Magento/Vault/etc/module.xml +++ b/app/code/Magento/Vault/etc/module.xml @@ -6,7 +6,7 @@ */ --> - +