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
- [Answer]-Django sqlite downgrade loaddata Could not load contenttypes.ContentType(pk=1): no such column: name
- [Answer]-Overriding form validation for empty "unique" field for Django Crispy Forms
- [Answer]-Is there a way to load Django template modules from code instead of templates?
- [Answer]-AngularJS $http.post not getting JSON success response. Instead redirects to URL of the REST endpoint
- [Answer]-Virtualenv and workon command – odd behavior in bash script