I have accidentally dropped a table in Django 1.7 project. I ran makemigrations
& migrate
. Both commands didn't recognized that table has dropped. So they had no affect.
Should I remove code for the model, make migration, add the code for the model & again migrate? Or is there a better way to recover it?
django-admin sql
command and recreate the table manually, but did you try to usemigrate
to go back to a version prior to the creation of that table, and then migrating again to the latest version? See also the--fake
switch tomigrate
, but I don't know if it would be useful here.