Using Django 1.7 migrations.
I accidentally dropped a table in my database. I assumed that by running migration again this would recreate the table but no, Django states "No migrations to apply".
How to I get Django to recreate the table?
I have run:
> makemigrations - No changes detected > migrate - No migrations to apply.
I have tried making a change to the model and running a new migration and it simply states that "Table 'x.test_customer' doesn't exist" which is correct, but what I was hoping it that it would recreate the table.
Go to your database and find the table django_migrations. Delete all the rows which have app equals your app name.
django_migrations
app
Then do a makemigrations & migrate will work.
makemigrations
migrate
1.4m articles
1.4m replys
5 comments
57.0k users