Migrating from django user model to a custom user model : <p>I am following these two references (<a href="https://code.djangoproject.com/ticket/25313" rel="noreferrer">one</a> and <a href="http://django-authtools.readthedocs.io/en/latest/how-to/migrate-to-a-custom-user-model.html" rel="noreferrer">two</a>) to have a custom user model in order to authenticate via email and also to add an extra field to it.</p>

<pre><code>class User(AbstractBaseUser, PermissionsMixin):
    email = models.EmailField(
        unique=True,
        max_length=254,
    )
    mobile_number = models.IntegerField(unique=True)
    is_active = models.BooleanField(default=True)
    is_admin = models.BooleanField(default=False)

    objects = UserManager()
    ...
    ...    
    class Meta:
        db_table = 'auth_user'
    ...
    ...
</code></pre>

<p>As you can see, I have added the <code>db_table='auth_user'</code> into the Meta fields of the class. Also, I have included <code>AUTH_USER_MODEL = 'accounts.User'</code> and User model app (i.e., accounts)into the <code>INSTALLED_APPS</code> in settings.py. Further more, I deleted the migrations folder from the app.</p>

<p>Then tried migrating:</p>

<pre><code>$ python manage.py makemigrations accounts
Migrations for 'accounts':
  accounts/migrations/0001_initial.py:
    - Create model User

$ python manage.py migrate accounts
</code></pre>

<p>Which gives me an error:</p>

<blockquote>
  <p>django.db.migrations.exceptions.InconsistentMigrationHistory: Migration admin.0001_initial is applied before its dependency accounts.0001_initial on database 'default'.</p>
</blockquote>

<p>How can I migrate from the existing django user model into a custom user model?</p>
