在Django 1.7c2中运行迁移时出现循环依赖性错误

jcu*_*uot 6 django django-migrations

我在https://docs.djangoproject.com/en/1.7/topics/migrations/上一直在阅读关于django迁移的内容.我还回顾了github上1.7.x分支的提交,我明白这个问题可能已经解决了.不幸的是,在运行迁移时我仍然遇到错误.--fake选项提供相同的错误.

我有以下迁移:

'人'应用迁移:

user@host$ /manage.py makemigrations people
Migrations for 'people':
0001_initial.py:
- Create model Person
- Create model Committee
- Create model DepartmentGroup
- Add field department_group to person
- Create model MemberType
- Add field member_type to person
- Alter unique_together for person (1 constraint(s))
- Create model PersonCommittee
- Add field committees to committee
- Add field committee to personcommittee
- Add field member to personcommittee
- Alter unique_together for personcommittee (1 constraint(s))
- Create model Role
- Create proxy model PersonArchive
Run Code Online (Sandbox Code Playgroud)

'locations'应用迁移:

user@host$ ./manage.py makemigrations locations
Migrations for 'locations':
0001_initial.py:
- Create model Building
- Create model Institution
- Create model InstitutionAddress
- Add field institution to building
- Add field address to institutionaddress
- Add field institution to institutionaddress
- Create model Room
- Alter unique_together for room (1 constraint(s))
Run Code Online (Sandbox Code Playgroud)

现在我运行迁移

./manage.py migrate
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误

django.db.migrations.graph.CircularDependencyError: 
[('people', u'0001_initial'), ('locations', u'0001_initial'), 
('people', u'0001_initial')]
Run Code Online (Sandbox Code Playgroud)

完整的错误可以在以下网址查看:http://pastebin.com/jixK6Ve2

我的问题是,如果django代码中仍然存在需要修复的内容,请参阅固定票证:https://code.djangoproject.com/ticket/22932.如果没有,是否可以选择以2个或更多步骤拆分迁移以避免循环依赖性错误?

jcu*_*uot 5

来自https://code.djangoproject.com/ticket/22932#comment:4的用户humitos指示的步骤似乎解决了这个问题.

我基本上需要删除可交换的依赖项和冲突的模型,并将它们放入一个新的空迁移中.