I'm creating a CRUD module for Magento2 with an EAV entity.
My first step is to install and uninstall the module.
My EAV entity is similar to products, categories and customers.
The install script works as the install from the customer module.
It adds the _int, _decimal, ...
tables and some rows in eav_entity_type
and eav_attribute
tables.
How can I trigger in my uninstall script the delete of these rows without running a raw query like DELETE FROM eav_entity_type WHERE ...
?
Actually I need to delete something only from the eav_entity_type
because the values from eav_attribute
should cascade.
My uninstall script follows standards.
I have the file in Setup/Uninstall.php
and it contains the method
public function uninstall(
\Magento\Framework\Setup\SchemaSetupInterface $setup,
\Magento\Framework\Setup\ModuleContextInterface $context
) {
....
}
The method gets called so this I've done right.