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

Leave a Reply

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