Can I delete the table from the Magento database when the module is disabled and uninstalled?
Because the table was created when the module is installed.
Magento 2 – Is It Possible to Delete Table from Database When Uninstalling Module?
databasemagento2
Best Answer
You can use the
UninstallInterface
of your module to drop the tables during uninstall process:app/code/Vendor/Module/Setup/Uninstall.php:
But this script works only when module has been installed using the Composer:
(additional information here).