title: Auto-generated field 'user_ptr' clashes with declared field of the same name
body: <p>I have a Django app that has CustomUser. My model looks something like</p>
  <pre><code>class CustomUser(AbstractBaseUser):
      def get_short_name(self):
          pass
  
      def get_full_name(self):
          pass
  
      firstName = models.CharField(max_length=300)
      middleName = models.CharField(max_length=300, blank=True)
      lastName = models.CharField(max_length=300, blank=True)
      username = models.CharField(unique=True, max_length=50)
      businessName = models.CharField(max_length=500, default=None)
      mobileNumber = models.CharField(max_length=20)
      contactNumber = models.CharField(max_length=20)
      addressLine1 = models.CharField(max_length=300)
      addressLine2 = models.CharField(max_length=300)
      city = models.CharField(max_length=300)
      state = models.CharField(max_length=300)
      role = models.CharField(max_length=20)
      email_id = models.CharField(max_length=300, unique=True)
      aadharNumber = models.BigIntegerField(default=0)
      panNumber = models.CharField(max_length=20, default=None)
      registrationDate = models.BigIntegerField(default=0)
      bankDetail = models.ManyToManyField('BankDetail', related_name=&quot;bankDetail&quot;)
      dateCreated = models.DateTimeField(auto_now_add=True)
      dateModified = models.DateTimeField(auto_now=True)
      objects = AccountManager()
  
      USERNAME_FIELD = 'email_id'
      REQUIRED_FIELDS = ['username'] 
  </code></pre>
  <p>I was following the example in this blog <a href="https://afropolymath.svbtle.com/authentication-using-django-rest-framework" rel="nofollow noreferrer">https://afropolymath.svbtle.com/authentication-using-django-rest-framework</a> to implement User authentication.</p>
  <p>I get the following error when I run <code>makemigrations</code>
  I did look at a few solutions on StackOverflow but those don't seem to solve my problem.</p>
  <p><a href="https://stackoverflow.com/questions/2606194/django-error-message-add-a-related-name-argument-to-the-definition">Django error message &quot;Add a related_name argument to the definition&quot;</a></p>
  <p><a href="https://stackoverflow.com/questions/39691785/alterfield-on-auto-generated-ptr-field-in-migration-causes-fielderror">AlterField on auto generated _ptr field in migration causes FieldError</a></p>
  <pre><code>Traceback (most recent call last):
    File &quot;manage.py&quot;, line 22, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File &quot;/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py&quot;, line 364, in execute_from_command_line
      utility.execute()
    File &quot;/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py&quot;, line 356, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File &quot;/usr/local/lib/python3.6/site-packages/django/core/management/base.py&quot;, line 283, in run_from_argv
      self.execute(*args, **cmd_options)
    File &quot;/usr/local/lib/python3.6/site-packages/django/core/management/base.py&quot;, line 330, in execute
      output = self.handle(*args, **options)
    File &quot;/usr/local/lib/python3.6/site-packages/django/core/management/commands/makemigrations.py&quot;, line 177, in handle
      migration_name=self.migration_name,
    File &quot;/usr/local/lib/python3.6/site-packages/django/db/migrations/autodetector.py&quot;, line 47, in changes
      changes = self._detect_changes(convert_apps, graph)
    File &quot;/usr/local/lib/python3.6/site-packages/django/db/migrations/autodetector.py&quot;, line 133, in _detect_changes
      self.old_apps = self.from_state.concrete_apps
    File &quot;/usr/local/lib/python3.6/site-packages/django/db/migrations/state.py&quot;, line 222, in concrete_apps
      self.apps = StateApps(self.real_apps, self.models, ignore_swappable=True)
    File &quot;/usr/local/lib/python3.6/site-packages/django/db/migrations/state.py&quot;, line 288, in __init__
      self.render_multiple(list(models.values()) + self.real_models)
    File &quot;/usr/local/lib/python3.6/site-packages/django/db/migrations/state.py&quot;, line 323, in render_multiple
      model.render(self)
    File &quot;/usr/local/lib/python3.6/site-packages/django/db/migrations/state.py&quot;, line 626, in render
      body,
    File &quot;/usr/local/lib/python3.6/site-packages/django/db/models/base.py&quot;, line 259, in __new__
      base.__name__,
  django.core.exceptions.FieldError: Auto-generated field 'user_ptr' in class 'CustomUser' for parent_link to base class 'User' clashes with declared field of the same name.
  customer ID&lt;django.db.models.fields.related_descriptors.ForwardManyToOneDescriptor object at 0x106341a58&gt;
  </code></pre>
  <p>What do I need to do to get rid of this error and proceed with a successful migration?</p>