Magento – Recurring Upgrade Scripts in Magento 2.0, 2.1, or 2.2

install-scriptmagento2migration

According to this dev doc (emphasis mine)

InstallData and InstallSchema scripts, which are executed on a clean (empty) database

UpgradeData and UpgradeSchema incremental scripts, which supplement an existing Magento database

Recurring scripts, which are executed each time you install or upgrade Magento

Does anyone know what feature this development document is talking about? As far as I recall, M2 only had InstallData, InstallSchema, UpgradeData and UpgradeSchema classes.

Best Answer

Alan, first of all, I want to say thank you for your blog. I learned a lot of Magento thing using it. Thanks a lot.

About the Recurring.php:

These scripts are fired every time u run setup:upgrade cli command and the good example of how it can be used you can find in Magento\Indexer\Setup\Recurring class where Magento_Indexer module checks for newly defined indexers and adds them to indexer_state table.

Related Topic