Up to versions 2.2 (including it) you could uninstall modules installed via composer and when you did that the method
Setup/Uninstall.php will be executed.
Basically this was the place to drop the tables that the module added and remove all the data. And do other fancy stuff.
Magento 2.3 now has a declarative schema and patches instead of
Is there an uninstall equivalent for magento 2.3 ?
I know that the installSchema and installData and Uninstall still work in Magento2.3, but I want to know if there is an alternative (best practice).
As an exercise, I have a module that creates a table
On uninstall I want to drop that table and remove from
core_config_data all the rows
where path like 'my_module/'.