MilestoneFEATURED IN LIVEMINT 40 UNDER 40 • RECOGNIZED BY FORBES INDIA • ISO 27001:2022 CERTIFIED
Magento 2

Create Data and Schema Patches in Magento 2

Kraftors TeamPublished June 5, 2021Updated September 21, 20263 views
Create Data and Schema Patches in Magento 2

A data patch is a class that contains data modification instructions like update, Insert, delete.
A schema patch is a class that contains schema modification instructions like create, drop, alter.

1. It is defined in a <Vendor>/<Module_Name>/Setup/Patch/Data/<Patch_Name>.php file and implements \Magento\Framework\Setup\Patch\DataPatchInterface

2. Patches will only be applied Once.

3. A list of applied patches is stored in the patch_list database table.

4. A patch will be applied when running the setup:upgrade from the Magento CLI.

To access the example on github Click here. Or click on this link
https://github.com/thekraftors/Magento2-schema-patch

Please follow and like us

Share this article with your network and stay updated with Kraftors insights.

K

Written by Kraftors Team

Discussion & Comments (0)

Join the conversation and share your feedback

No comments yet. Be the first to start the discussion!

Leave a Reply

Your email address will not be published. Required fields are marked *