I just learned that I should be more careful after installing any package in Django. This is I should dump my database (or simply copy the the database file) before migrating or syncdb it when I install a new plugin.
Now, it is to late. I have installed and removed several packages (pip install package
and python manage.py migrate
) and I would like to clean or purge my database, so I get rid of tables and fields no longer used.
Is there any way of search and/or remove fields and tables that are no longer in use by the INSTALLED_APPS
?
It seems possible to iterate over all the INSTALLED_APPS models.py
files and compare them with the current state of the database. Another option would be to generate a completely new database and compare it with the old one.