title: Django migration file in an other app?
body: <p>Let's imagine a following simplified Django project:</p>
  
  <pre><code>&lt;root&gt;/lib/python2.7/site-packages/externalapp/shop
  &lt;root&gt;/myapp
  </code></pre>
  
  <p><code>myapp</code> also extends <code>externalapp.shop.models</code> models by adding a few fields. <code>manage.py makemigrations</code> did generated following schema migration file called <em>0004_auto_20150410_2001.py</em>:</p>
  
  <pre><code>from __future__ import unicode_literals
  from django.db import models, migrations
  
  
  class Migration(migrations.Migration):
  
      # __init__ is added by me as an attempt how to tell django's
      # migration loader operations are for the different application
      def __init__(self, name, app_label):
          super(Migration, self).__init__(name, 'shop')
  
      dependencies = [
          ('myapp', '__first__'),
          ('shop', '0003_auto_20150408_0958'),
      ]
  
      operations = [
          migrations.AddField(
              model_name='product',
              name='vat',
              field=models.ForeignKey(to='myapp.VAT', null=True),
          ),
      ]
  </code></pre>
  
  <p>If the above migration schema is placed in <code>&lt;root&gt;/lib/python2.7/site-packages/externalapp/shop/migrations/</code> path by default, <code>manage.py migrate</code> succeeds and table fields are correctly added.</p>
  
  <p>However if I do move the above migration file into <code>myapp/migrations/</code>, following <code>manage.py migrate</code> fails with</p>
  
  <p><em>django.core.management.base.CommandError: Conflicting migrations detected (0001_initial, 0004_auto_20150410_2001 in myapp).
  To fix them run 'python manage.py makemigrations --merge'</em></p>
  
  <p>error message I can't quite understand and suggested <code>makemigrations --merge</code> fails with expected:</p>
  
  <p><em>ValueError: Could not find common ancestor of set([u'0001_initial', u'0004_auto_20150410_2001'])</em></p>
  
  <p>I've tried to override <code>migrations.Migration.__init__</code> to alter derived <code>app_label</code> but seems migration loader ignores it.</p>
  
  <p>How adjust migration file so it can work from other application ?
  The reason is in production <code>externalapp</code> sources can't be directly touched, are read only.</p>