3

I have received this error when making migrations

file "/home/rickus/.local/lib/python2.7/site-packages/django/db/migrations/loader.py", line 285, in check_consistent_history
migration[0], migration[1], parent[0], parent[1],
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration authtoken.0001_initial is applied before its dependency users.0001_initial

so I deleted all the migrations on my project and tried again. before I ran make migrations again I ran show migrations and all the migration files are showing in the show migrations output even though I deleted the actual files

admin
[X] 0001_initial
 [X] 0002_logentry_remove_auto_add
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 [X] 0003_alter_user_email_max_length
 [X] 0004_alter_user_username_opts
 [X] 0005_alter_user_last_login_null
 [X] 0006_require_contenttypes_0002
 [X] 0007_alter_validators_add_error_messages
 [X] 0008_alter_user_username_max_length
authtoken
 [X] 0001_initial
 [X] 0002_auto_20160226_1747
contenttypes
 [X] 0001_initial
 [X] 0002_remove_content_type_name
sessions
 [X] 0001_initial
users
 (no migrations)

I'm trying to fix this error but I am unsure of what to do. How is it that my show migrations is showing files I deleted? What is the best way to solve this problem? Also I am unable to locate my database, I would guess because at this point it has yet to be created? But I am sure that is wrong.

  • 1
    You need to reset the migration history in the database, not just delete the migration files. See [How to reset migrations in Django 1.7](http://stackoverflow.com/questions/29253399/how-to-reset-migrations-in-django-1-7). – Kevin Christopher Henry Mar 06 '17 at 20:43
  • thanks man I appreciate it –  Mar 06 '17 at 21:12

0 Answers0