PHPackages                             discorgento/module-migrations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. discorgento/module-migrations

ActiveMagento2-module[Database &amp; ORM](/categories/database)

discorgento/module-migrations
=============================

A dev-friendly approach to quickly create migrations (patch data) on Magento 2

2.10.1(2mo ago)2516.7k↓24.4%4MITPHPPHP &gt;=8.1 &lt;8.5

Since Aug 7Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/discorgento/module-migrations)[ Packagist](https://packagist.org/packages/discorgento/module-migrations)[ RSS](/packages/discorgento-module-migrations/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (26)Used By (0)

[![Discorgento Migrations](docs/header.png)](docs/header.png)
=============================================================

[](#)

A dev-friendly approach to keep track of database changes in Magento 2

 [![GitHub Stars](https://camo.githubusercontent.com/01af90f14e023f9c49d2ca5b1a385bcee063eb6a8d98f490645d6f26f88d7b02/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f646973636f7267656e746f2f6d6f64756c652d6d6967726174696f6e733f7374796c653d736f6369616c)](https://github.com/discorgento/module-migrations/stargazers) [![Total Downloads](https://camo.githubusercontent.com/9adf5b68ce703590b245942bdb24fcdd9768e1e49e3888ad6f6fc9a7c38f032d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f646973636f7267656e746f2f6d6f64756c652d6d6967726174696f6e73)](https://packagist.org/packages/discorgento/module-migrations/stats) [![Latest Version on Packagist](https://camo.githubusercontent.com/26c40d7eaf1a4d2d0a7245826e4bc58a43ca6c13e0f995cc8ce328ad783fd0e9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f646973636f7267656e746f2f6d6f64756c652d6d6967726174696f6e73)](https://packagist.org/packages/discorgento/module-migrations) [![Join our Discord](https://camo.githubusercontent.com/c448784fc6c083dd1207f1fa1f0b89cf402e27bdb1a717cf558d4f56c3da4ecf/68747470733a2f2f696d672e736869656c64732e696f2f646973636f72642f3736383635333234383930323333323432383f636f6c6f723d253233373238396439266c6162656c3d446973636f7264)](https://discorgento.com/discord)

Sponsors

 [![Caravel X](docs/sponsors/caravel.svg)](https://www.caravel.com.br/)

\[[Install](#-Install)\] \[[Usage](#-Usage)\] \[[🎭 Facades](#-Facades)\] \[[Notes](#-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](https://developer.adobe.com/commerce/php/development/components/declarative-schema/patches/) out of the box, but writing them can get verbose and repetitive quickly. This module greatly simplifies such process.

[![image](docs/tldr.png)](docs/tldr.png)From 50 lines to just 15, or simply 70% less code. SEVENTY percent fewer lines. But we're just getting started.

📥 Install
---------

[](#-install)

```
composer require discorgento/module-migrations
```

Note

This module is compatible with Magento 2.4.6 onward, from PHP 8.1 to 8.4.

🛠️ Usage
--------

[](#️-usage)

### Demo

[](#demo)

[![](https://user-images.githubusercontent.com/4603111/202745678-d9960d66-4618-4100-aee1-50a4cc728829.png)](https://odysee.com/@discorgento:8/Introduction-to-Module-Migrations-Magento-discorgento-module-migrations:a)

> There's also an extended version in Brazilian Portuguese including CMS content management overview available [here](https://odysee.com/@discorgento:8/Introdu%C3%A7%C3%A3o-ao-Modulo-Migrations-Magento-discorgento-module-migrations:9).

### Basic Usage

[](#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 run `bin/magento setup:upgrade`.

Sample data patch:

```
