Skip to content

Patches

Module patch creation

You can create a new system by clicking Generate > Patch button from the module detail view.

Patch create

The following files are created in app/code/Vendor/Module when you create a patch:

  • Setup/Patch/[Data|Schema]/<PatchName>Patch.php

Example of a generated patch

PHP class

php
<?php

declare(strict_types=1);

namespace MB\Test\Setup\Patch\Data;

use Magento\Framework\Setup\Patch\DataPatchInterface;

class TestPatch implements DataPatchInterface
{
    public function apply(): void
    {
        // Add your code here
    }

    public static function getDependencies(): array
    {
        return [];
    }

    public function getAliases(): array
    {
        return [];
    }
}

Released under the MIT License.
This project is not affiliated with, endorsed by, or sponsored by Adobe Inc. "Magento" and "Adobe Commerce" are trademarks of Adobe Inc.
All trademarks and registered trademarks are the property of their respective owners.