Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rririanto/d1dad8c3767d3995387496a41979c785 to your computer and use it in GitHub Desktop.
Save rririanto/d1dad8c3767d3995387496a41979c785 to your computer and use it in GitHub Desktop.
django.db.utils.OperationalError: Problem installing fixtures: no such table: __old
I use django 1.11.19
Problem
django.db.utils.OperationalError: Problem installing fixtures: no such table: tour_city__old
Solved:
1. edited $ open yourvirtualenv/lib/python2.7/site-packages/django/db/backends/sqlite3/schema.py
2. add the line "c.execute('PRAGMA legacy_alter_table = ON')" after "c.execute('PRAGMA foreign_keys = 0')"
3. Delete the SQLite db
4. python manage.py migrate
3. python manage.py loaddata fixture.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment