Django manage.py: Migration applied before its dependency
<p>When running <code>python manage.py migrate</code> I encounter this error:</p>

<pre><code>django.db.migrations.exceptions.InconsistentMigrationHistory: Migration
&lt;appname&gt;.0016_auto_&lt;date2&gt;_&lt;time2&gt; is applied before its dependency
&lt;appname&gt;.0001_squashed_0015_auto_&lt;date1&gt;_&lt;time1&gt;
</code></pre>

<p>running showmigrations returns:</p>

<pre><code>&lt;appname&gt;
 [X] 0001_squashed_0015_auto_&lt;date1&gt;_&lt;time1&gt; (15 squashed migrations)
 [X] 0016_auto_&lt;date2&gt;_&lt;time2&gt;
 [ ] 0017_&lt;modelname&gt;_squashed_0019_auto_&lt;date3&gt;_&lt;time3&gt; (3 squashed migrations)
</code></pre>

<p>I was trying out django-extensions yesterday, when it all got messed up after me running some direct SQL queries and I reset hard using git. I'm still learning about migrations, so I don't understand what is wrong, since it seems to me that both migrations already have been applied.</p>

<p>Thank you for your help!</p>