I have a third-party application in my Django project that I'd like to remove. My problem is that if I simply remove it from INSTALLED_APPS, all the models and associated tables that it created in my database will be kept.
I know I can manually DROP thoses tables afterwards but I want this to be automated (since there are multiple running instances of this project, I don't want to ask people to run any manual command when upgrading). I'm wondering if there is a recommended or "clean" way to do so with Django migrations.
I created a migration file in one of my apps (the one that used this third-party app) with a migrations.DeleteModel(name='ThirdPartyModel') but it fails to execute because this model is managed by the other app.
What is left it to write a RunSQL migration whith a DROP TABLE thirdpartyapp_thirdpartymodel and a DELETE FROM django_content_type WHERE app_label = thirdpartyapp AND model = thirdpartymodel.
Is there any other option? How are these types of operations supposed to be done?
I'm using Django 3.0.