Every time a module is installed via a php bin/magento module:enable command, Magento shows the following message: To make sure that the enabled modules are properly registered, run 'setup:upgrade'. The php bin/magento setup:upgrade command upgrades the Magento application, database data, and schema. Once triggered, the upgrade command instantiates Magento\Setup\Model\Installer, which then goes through a series of methods. Its getSchemaDataHandler method reveals the types of available setup scripts:
- InstallSchema.php
- UpgradeSchema.php
- Recurring.php
- InstallData.php
- UpgradeData.php
- RecurringData.php
These scripts live under the <VendorName>/<ModuleName>/Setup directory.
Once successfully finished, the setup:upgrade command makes a new entry, or updates an existing one, in the setup_module table. There, we can see the schema_version...