2

why developer does not use UninstallInterface for every modules they develop so module can uninstall completely. is there any problem to delete tables from database after uninstall modules?

app/code/Vendor/Module/Setup/Uninstall.php

<?php

namespace Vendor\Module\Setup;

use Magento\Framework\Setup\UninstallInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;

class Uninstall implements UninstallInterface
{
    /**
     * Module uninstall code
     *
     * @param SchemaSetupInterface $setup
     * @param ModuleContextInterface $context
     * @return void
     */
    public function uninstall(
        SchemaSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $setup->startSetup();
        $connection = $setup->getConnection();
        $connection->dropTable($connection->getTableName('your_table_name_here'));
        $setup->endSetup();
    }
}
  • No, there should not be an issue with manually deleting the tables. Obviously make absolutely sure you don't need the data. – Steve Johnson Oct 10 '16 at 19:04
1

I suppose it's because the module should be installed via composer to be able run uninstall script.

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.