Download the PHP package discorgento/module-migrations without Composer
On this page you can find all versions of the php package discorgento/module-migrations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download discorgento/module-migrations
More information about discorgento/module-migrations
Files in discorgento/module-migrations
Package module-migrations
Short Description A dev-friendly approach to quickly create migrations (patch data) on Magento 2
License MIT
Informations about the package module-migrations
A dev-friendly approach to keep track of database changes in Magento 2
Sponsors
[Notes]
Just changed something on the admin panel or on the database and now you need to replicate it again in all project environments, including other dev machines?
Magento supports data patches out of the box, but writing them can get verbose and repetitive quickly. This module greatly simplifies such process.
From 50 lines to just 15, or simply 70% less code. SEVENTY percent fewer lines. But we're just getting started.
📥 Install
[!NOTE]
This module is compatible with Magento 2.4.6 onward, from PHP 8.1 to 8.4.
🛠️ Usage
Demo
There's also an extended version in Brazilian Portuguese including CMS content management overview available here.
Basic Usage
- in the module you're developing, create a php class under its Setup/Patch/Data/ dir;
- make it extend
Discorgento\Migrations\Setup\Migration; - put your logic inside the
execute(), and runbin/magento setup:upgrade.
Sample data patch:
Then run:
That's it, you successfully ensured that your database changes got tracked in all enviroments.
Facades
Besides simplifying the basic data patch structure, this module also provides helpers for common Magento patch tasks, such as admin config, CMS content, and EAV attributes. Use these when your patch needs to create or update Magento data without writing the same low-level setup code every time.
See FACADES.md for more details, shared helper methods, and the full helper reference.
🗒 Notes
- create an issue in this repo to report a bug;
- Pull Requests are welcome;
- we want YOU for our community!
