QuestionQ14

Working with Databases and EAV

An Adobe Commerce developer is building a Marketplace module (Vendor_ModuleName). The module creates a database table through declarative schema, and the developer now needs to ensure that the table is removed when the module is disabled.

What must the developer do to achieve this?

Explanation

When a module that uses declarative schema is disabled, Commerce no longer reads that module’s database-schema configuration. Running bin/magento setup:upgrade reconciles the database with the remaining declared schema and drops the disabled module’s declared table. A PatchRevertableInterface implementation is only needed when a patch must be rolled back during module uninstallation.

Learn more

Community Discussion

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