Hi I am trying to remove the category attribute using Uninstall script but it is not working. Here is my code. Setup\Uninstall.php
<?php
namespace Company\Module\Setup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\UninstallInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\Setup\ModuleContextInterface;
class Uninstall implements UninstallInterface
{
protected $eavSetupFactory;
public function __construct(EavSetupFactory $eavSetupFactory)
{
$this->eavSetupFactory = $eavSetupFactory;
}
public function uninstall(SchemaSetupInterface $setup, ModuleContextInterface $context)
{
$setup->startSetup();
$eavSetup = $this->eavSetupFactory->create();
$entityTypeId = 3;
// $entityTypeId = \Magento\Catalog\Model\Category::ENTITY;
if (version_compare($context->getVersion(), '1.0.4') < 0) {
$eavSetup->removeAttribute($entityTypeId, 'test_input_field');
}
$setup->endSetup();
}
}
Any help appreciated.
php bin/magento module:uninstall
command? – Dominic Xigen Jun 10 '19 at 13:33magento module:uninstall Magento_SampleMinimal
– Dominic Xigen Jun 10 '19 at 13:39