Fix Conflicting migrations detected in Django1.9

后端 未结 2 727
臣服心动
臣服心动 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'),
        ]
    

提交回复
热议问题