If you install the module via composer, you can have create the Setup/Uninstall.php
file that will be executed when running bin/magento module:uninstall -r [Namespace]_[Module]
.
The Uninstall.php
file should look like this:
<?php
namespace Namespace\Module\Setup;
class Uninstall implements \Magento\Framework\Setup\UninstallInterface
{
public function uninstall(
\Magento\Framework\Setup\SchemaSetupInterface $setup,
\Magento\Framework\Setup\ModuleContextInterface $context
) {
if ($setup->tableExists('table_name_here')) {
$setup->getConnection()->dropTable('table_name_here');
}
}
}
If you installed the module manually, you will need to cleanup your database manually also buy dropping the tables the module added.