title: Django claiming inconsistent migration history on first migration
body: <p>I have been working on a project for a while, and I have been having no trouble with migrations.  I decided reset the database and migrations, which I do from time to time.  I went to delete all migrations, make them again, and after recreating the database, apply the migrations, at which point, I get the error &quot;<code>Migration users.0001_initial is applied before its dependency auth.0012_alter_user_first_name_max_length on database 'default'.</code>&quot;</p>
  <p>Now, <code>auth.0012_alter_user_first_name_max_length</code> is apparently coming from <code>django.contrib.auth</code>, which is part of core django, so I don't see why I need any dependency on its migrations for a new project, yet whenever I make migrations on this project from the beginning, it adds a dependency to my user model of <code>auth.0012_alter_user_first_name_max_length</code>.  I don't know why it does that, when it apparently wasn't doing that yesterday, but I am now having to remove that dependency from the user migration manually before it will migrate.</p>
  <p>What might cause this.</p>
  <p>Here is my users.models.py file.  Maybe someone can figure out what would be so odd about it that it would do this.</p>
  <pre class="lang-py prettyprint-override"><code>from django.contrib.auth.models import AbstractUser
  from django.db.models import CharField, EmailField
  from django.urls import reverse
  from django.utils.translation import gettext_lazy as _
  from phonenumber_field.modelfields import PhoneNumberField
  from django.contrib.auth.models import UserManager
  from django.db.models import Q
  
  
  # Override UserManager and allow login with both username and email address
  class CustomUserManager(UserManager):
      def get_by_natural_key(self, username):
          return self.get(
              Q(**{self.model.USERNAME_FIELD: username}) |
              Q(**{self.model.EMAIL_FIELD: username})
          )
  
  
  class User(AbstractUser):
      class Meta(object):
          unique_together = ('email',)
      email = EmailField(_('email address'), unique=True, blank=True, max_length=255)
      phone_number = PhoneNumberField(_('Phone number'), blank=True)
      address = CharField(_(&quot;Street address&quot;), blank=True, max_length=255)
      city = CharField(_(&quot;City&quot;), blank=True, max_length=255)
      state = CharField(_(&quot;State&quot;), blank=True, max_length=255)
      zip = CharField(_(&quot;ZIP&quot;), blank=True, max_length=255)
  
      USERNAME_FIELD = 'username'
      REQUIRED_FIELDS = ['first_name', 'last_name', 'email']
      # for allowing both username and email login
      objects = CustomUserManager()
  
      def get_absolute_url(self):
          &quot;&quot;&quot;Get url for user's detail view.
  
          Returns:
              str: URL for user detail.
  
          &quot;&quot;&quot;
          return reverse(&quot;users:detail&quot;, kwargs={&quot;username&quot;: self.username})
  
  </code></pre>