Reset Django migrations: relation "django_migrations" does not exist
<p>I somehow screwed up my migrations when creating the database for a new project. I now have the problem of migrations that don't apply:</p>

<pre><code>Operations to perform:
  Apply all migrations: wagtailusers, wagtailembeds, wagtailadmin, sessions, admin, wagtailcore, auth, contenttypes, wagtaildocs, taggit, wagtailsearch, home, wagtailforms, wagtailredirects, wagtailimages
Running migrations:
  No migrations to apply.
</code></pre>

<p>Based on <a href="https://stackoverflow.com/questions/29253399/how-to-reset-migrations-in-django-1-7">this answer</a> (and a few others), it seems like my best bet is to clear stuff out of the <code>django_migrations</code> table. So I ran:</p>

<pre><code>DELETE FROM django_migrations WHERE app='wagtailusers';
</code></pre>

<p>and got the error:</p>

<pre><code>ERROR:  relation "django_migrations" does not exist
</code></pre>

<p>How can django_migrations not exist? What am I doing wrong? I basically want to scrub everything in the database and all the migrations and start over from scratch, but it's apparently far more complicated than I suspected. (Is there a simpler way to basically start over with the database and migrations?)</p>

<p><strong>EDIT:</strong></p>

<p>I tried reverting one app and migrating it forward again.</p>

<p>I ran <code>./manage.py showmigrations wagtailusers</code>, which showed all migrations applied:</p>

<pre><code>wagtailusers
 [X] 0001_initial
 [X] 0002_add_verbose_name_on_userprofile
 [X] 0003_add_verbose_names
 [X] 0004_capitalizeverbose
</code></pre>

<p>I then unapplied all of the migrations with <code>./manage.py migrate wagtailusers zero</code>:</p>

<pre><code>Operations to perform:
  Unapply all migrations: wagtailusers
Running migrations:
  Rendering model states... DONE
  Unapplying wagtailusers.0004_capitalizeverbose... OK
  Unapplying wagtailusers.0003_add_verbose_names... OK
  Unapplying wagtailusers.0002_add_verbose_name_on_userprofile... OK
  Unapplying wagtailusers.0001_initial... OK
</code></pre>

<p><code>showmigrations</code> then shows them all unapplied. So I then reapply the migrations with <code>./manage.py migrate wagtailusers</code>:</p>

<pre><code>Operations to perform:
  Apply all migrations: wagtailusers
Running migrations:
  Rendering model states... DONE
  Applying wagtailusers.0001_initial... OK
  Applying wagtailusers.0002_add_verbose_name_on_userprofile... OK
  Applying wagtailusers.0003_add_verbose_names... OK
  Applying wagtailusers.0004_capitalizeverbose... OK
</code></pre>

<p>Everything is checked in <code>showmigrations</code>. But when I run migrate again, it still seems to think there's something missing?</p>

<pre><code>Operations to perform:
  Apply all migrations: wagtailusers
Running migrations:
  No migrations to apply.
</code></pre>