I want to know if any one could give a complete list of things which need to be done when we want to remove a model from Django. I know that a similar question was asked. But it seems to be several years ago, when people were still using South to deal with Database. So I expect an answer for the recent version of Django.
I conclude what I know as follows:
- Delete the codes for model from model.py
- Make sure that no other file imports this model or uses them (admin.py, views.py, etc)
- Run makemigrations and migrate commands
- Since Django doesn't clean database for you, you delete the table of this model manually from you database
- Also note that there is a table called ContentTypes, which keeps records about the info our your every model. So you need to delete the record for this model manually (But I don't know how to do it exactly. Would any one give some explanation?)
These are all the things I know. Is there anything wrong? And did I forget anything? Maybe I'm over-cautious, but I'd like to keep the database clean. Thanks a lot!