title: InconsistentMigrationHistory - Migration .. is applied before its dependency
body: <p>I have 2 models which are interdependent one of another:</p>
  
  <pre><code>class Account(models.Model):
      created_by = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True,related_name='%(app_label)s_%  (class)s_created_by', on_delete=models.CASCADE)
      updated_by = models.ForeignKey(settings.AUTH_USER_MODEL, blank=True, null=True, related_name='%(app_label)s_%(class)s_updated_by', on_delete=models.CASCADE)
  
  
  class User(AbstractBaseUser, MetaData, PermissionsMixin):
      account = models.ForeignKey(Account, blank=True, null=True, related_name='owner', on_delete=models.CASCADE)
  </code></pre>
  
  <p>I have issues:</p>
  
  <pre><code>InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency users.0001_initial on database 'default'.
  </code></pre>
  
  <p>I tried to remove from the User the account foreign key, migrate User, then migrate accounts, account FK fails, same error. </p>
  
  <p>I tried to do it starting from the Account it fails, removing FK to users.</p>
  
  <p>I'm interested in doing it on a new database(server) and reset on an old database local.</p>
  
  <p>On the old database, I removed my models  from <code>django_migrations</code>, and commented the dependencies between Models and associated foreign key. Tried a fake migration, still sees a dependency and I don't understand from where.</p>