I created an attribute in patch data class, and I created a table cloumn in the patch schema class. I don't know the difference between the two.

1 Answer 1


Schema patch is a class in Magento 2 that contains schema modification instructions so you can add, update, or delete columns in any custom table or EAV table. A schema patch contains custom schema modification instructions. These modifications can be complex. It is defined in a <Vendor>/<Module_Name>/Setup/Patch/Schema/<Patch_Name>.php file and implements \Magento\Framework\Setup\Patch\SchemaPatchInterface.

On the other hand, A Data patch is a class that contains data modification instructions. It is defined in a <Vendor>/<Module_Name>/Setup/Patch/Data/<Patch_Name>.php file and implements \Magento\Framework\Setup\Patch\DataPatchInterface.

  • 1
    Thank you for your reply,brother
    – Allen
    Aug 23 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.