U
U
undeadter2016-06-08 20:13:56
PostgreSQL
undeadter, 2016-06-08 20:13:56

Django - How to automatically create a database table structure from scratch if it was deleted?

Django 1.9.7 - Removed migrations directory and table in database model. How to restore the model table structure? First I do makemigrations, then migrate, I get an error that the table was not found. Manually create? Or is there an automated way? if so, which one?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir, 2016-06-08
@undeadter

clear django_migrations table

M
marazmiki, 2016-06-09
@marazmiki

If you have removed the migrations module, then Django will not track changes to the model schema. Create this module again (the migrations directory and an empty __init__.py file in it) and then run makemigrations

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question