The recommended best practice is to use the PatchRevertableInterface when creating data patches. This interface defines a revert() method, which is executed during module uninstall, ensuring that added entities (such as product attributes) are properly removed.
B (deleting from database directly) is strongly discouraged and violates upgrade safety.
C (creating a CLI command) is unnecessary; uninstallation should be handled within the patch itself.
[Reference:, , Adobe Commerce DevDocs – Data patches and PatchRevertableInterface, ]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit