Patches
Module patch creation
You can create a new system by clicking Generate
> Patch
button from the module detail view.
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 [];
}
}