[Answer]-Django South – Migration not re-creating model after dropping table from sqlite3

1👍

✅

Finally after a lot of trial and error, something very simple worked for me. I did not have much luck with the south migrations. So as I had manually dropped the table from sqlite3, I decided to manually create the table in sqlite3 and everything worked perfectly fine.
I used the below script on the sqlite3 prompt and it solved my issue and I was able to access the approval page correctly through my admin site and perform all CRUD operations on it.

CREATE TABLE "myapp_approval" ("id" integer NOT NULL PRIMARY KEY, "desc" varchar(256) NOT NULL);

Thanks everyone for your help and support!

0👍

You have already created a migration that creates the new table, and according to South’s history management, you’ve run this migration. South does not know about the actual changes to your database.

What you need to do is to revert to a migration before the new table was created. If you look in your apps folder, you’ll find a migrations folder with some migration files in it. If you created the new table in e.g. migration 0005, you need to (optionally) migrate backwards to 0005, and then you need to fake a backwards migration to 0004 and migrate again:

manage.py migrate myapp 0005
manage.py migrate myapp 0004 --fake
manage.py migrate myapp

Leave a comment