Creating an upgrade schema script (UpgradeSchema.php)
During the first-time module install, an upgrade schema is what gets run immediately after an install schema. We define upgrade schema within the app/code/Foggyline/Office/Setup/UpgradeSchema.php
file with (partial) content as follows:
namespace Foggyline\Office\Setup; use Magento\Framework\Setup\UpgradeSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; class UpgradeSchema implements UpgradeSchemaInterface { public function upgrade(SchemaSetupInterface $setup, ModuleContextInterface $context) { $setup->startSetup(); /* #snippet1 */ $setup->endSetup(); } }
UpgradeSchema
conforms to UpgradeSchemaInterface
, which requires the implementation of the upgrade
method that accepts two parameters of type SchemaSetupInterface
and ModuleContextInterface
.
This is quite similar to InstallSchemaInterface
, except the method name. The update
...