S
S
sazhyk2016-03-13 13:46:44
PostgreSQL
sazhyk, 2016-03-13 13:46:44

How to remove table from database from old app in Django?

There is a project on Django 1.9. The point is this. I add some application
to the section . INSTALLED_APPS = []I start python manage.py makemigrations, python manage.py migrateuse it and understand that I do not need it. I remove it from the section INSTALLED_APPS = [], delete records about it from all dependent files. But the trouble is, this application leaves tables in the database. Question actually: how to get rid of these tables means of Django? Of course, you can simply remove them from the database manually, but I thought there were ways to automate this process. I read the official documentation, but I’m just not strong in bourgeois, apparently I missed something (unless, of course, there is such a method in the documentation).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Vorobyov, 2016-03-13
@sazhyk

1. Return all models in the form corresponding to the last migration.
2. Return app to INSTALLED_APPS
3. Remove models from models.py
4. Create migrations
5. Apply migrations
6. Remove app from directory and INSTALLED_APPS

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question