UpgradeSchema.php 925 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\TestSetupDeclarationModule7\Setup;
  7. use Magento\Framework\Setup\InstallSchemaInterface;
  8. use Magento\Framework\Setup\ModuleContextInterface;
  9. use Magento\Framework\Setup\SchemaSetupInterface;
  10. use Magento\Framework\Setup\UpgradeSchemaInterface;
  11. /**
  12. * UpgradeSchema mock class
  13. */
  14. class UpgradeSchema implements UpgradeSchemaInterface
  15. {
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context)
  20. {
  21. $installer = $setup;
  22. $installer->startSetup();
  23. if (version_compare($context->getVersion(), '2.0.1') < 0) {
  24. $installer
  25. ->getConnection()
  26. ->modifyColumn('test_table', 'float', ['type' => 'float', 'default' => 29]);
  27. }
  28. $installer->endSetup();
  29. }
  30. }