django migrations issue NodeNotFoundError

1k Views Asked by At

I had to migrate a predefined database so that it works with the django orm. I created the migration files one after another and everything worked as it should. It took 12 migrations. After that I could get a fresh copy of the db and re-apply migrations and this would work. Today I created some more migration to present it to a member of my team. So I added some tables removed some fields etc till I got to migration no 17. After he was satisfied I said ok, lets delete the migrate files (the extras) and take a fresh copy of the db and reapply them. But all hell broke loose. I get an Exception

django.db.migrations.graph.NodeNotFoundError: Migration ci_models.0017_auto_20150611_1036 dependencies reference nonexistent parent node (u'ci_models', u'0016_auto_20150611_1031')

I can understand that it has kept the version that it goes till 0017 and searches for 0016 which won't find. How can I reset that? Every migration manage command I try gives me this error. Database is SQLite.

1

There are 1 best solutions below

0
On

Just for reference...Always hit refresh in Eclipse. It seems one file was left (no 17) so It gave me the error.