I created entity type my_entity in my module. But now I don't need this entity anymore and I want to completely remove it without module's uninstall. I want to remove both definition and all database related tables or data. I thought about using \Drupal::entityDefinitionUpdateManager->uninstallEntityType('my_entity')
in hook_update_N
, but I can't use it because entity's definition will be removed.
Could anyone help me, and give advice how to delete both definition and database data?
UPD: I created an issue on drupal.org about this https://www.drupal.org/node/2655162