Fix Conflicting migrations detected in Django1.9

后端 未结 2 729
臣服心动
臣服心动 2021-02-19 17:20

I updated django-dynamic-model repository to support Django 1.9. I got this error:

CommandError: 

Conflicting migrations detected; multiple leaf nodes in the mi         


        
相关标签:
2条回答
  • 2021-02-19 17:31

    The migrations need to have "straight" dependency chain, i.e. migration 0003 needs to depend on migration 0002, and 0002 on 0001.

    You need to define this in the 0003_third.py like this:

    class Migration(migrations.Migration):
        dependencies = [
            ('modulename', '0002_second'),
        ]
    
    0 讨论(0)
  • 2021-02-19 17:43

    Seems like you have injected models of other applications.

    Define TARGET_APP in your migrations, seems like migrations loader can't correctly identify target app.

    0 讨论(0)
提交回复
热议问题