2016-04-15 25 views
4

Django 1.9をサポートするためにdjango-dynamic-modelリポジトリを更新しました。私はこのエラーを得た:python manage.py makemigrations --mergeを実行した後修正Django1.9で検出された競合する移行

CommandError: 

Conflicting migrations detected; multiple leaf nodes in the migration 
graph: (0001_initial, 0002_auto__add_field_dynamicschemafield_extra in 
dynamicmodel). 
To fix them run 'python manage.py makemigrations --merge' 

を、私は別のエラーを得た:

File "/local/lib/python2.7/sitepackages/django/core/management/__init__.py", 
line 353, in execute_from_command_line 
utility.execute() 

File "/local/lib/python2.7/sitepackages/django/core/management/__init__.py", line 345, in execute 
self.fetch_command(subcommand).run_from_argv(self.argv) 

File 
"/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv 
self.execute(*args, **cmd_options) 

File 
"/local/lib/python2.7/site-packages/django/core/management/base.py", line 399, in execute 
output = self.handle(*args, **options) 

File 
"/local/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 97, in handle 
return self.handle_merge(loader, conflicts) 

File 
    "/local/lib/python2.7/site-packages/django/core/management/commands/makemigrations.py", line 216, in handle_merge 
raise ValueError("Could not find common ancestor of %s" % migration_names) 


ValueError: Could not find common ancestor of set([u'0001_initial', u'0002_auto__add_field_dynamicschemafield_extra']). 

は解決策を見つけるために私を助けて。

答えて

0

他のアプリケーションのモデルを注入したようです。

移行でTARGET_APPを定義すると、移行ローダーがターゲットアプリを正しく識別できないようです。

+0

「TARGET_APP」とは何ですか?私はDjango 1.8を使用していて、明示的に '--merge'の後にアプリケーション名を与えようとしましたが、どちらも役に立たなかった –

+1

' TARGET_APP'は移行ファイル内の変数であり、移行のパラメータではありませんスクリプトhttps://stackoverflow.com/questions/29575802/django-migration-file-in-an-other-app –

0

移行は「ストレート」依存チェーンを持っている必要があり、すなわち移行0003はあなたがこのような0003_third.pyでこれを定義する必要が0001

に移行0002、および0002に依存する必要があります。

関連する問題