Южно-круговая зависимость Джанго

У меня есть приложение (назовем его MyApp) в проекте Django 1.5. MyApp определяет пользовательскую модель пользователя (MyUser). В проекте используется другое приложение (AnotherApp), которое ссылается на MyUser. MyApp ссылается на поля в AnotherApp.

На моем ноутбуке для разработки все работало нормально. Я пытаюсь развернуть свой проект на сервере, и когда я перехожу к этапу миграции, происходит сбой MyApp из-за зависимости от AnotherApp, а AnotherApp - из-за зависимости от MyApp (я пытался переносить приложения независимо). Оба терпят неудачу на их соответствующих первых миграциях (0001)

Running migrations for myapp:
 - Migrating forwards to 0017_auto__blah_blah.
 > myapp:0001_initial
FATAL ERROR - The following SQL query failed: ALTER TABLE "myapp_mymodel_othermodel" ADD CONSTRAINT "othermodel_id_refs_id_ae052c6d" FOREIGN KEY ("othermodel_id") REFERENCES "anotherapp_othermodel" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "anotherapp_othermodel" does not exist

Error in migration: myapp:0001_initial
DatabaseError: relation "anotherapp_othermodel" does not exist


Running migrations for anotherapp:
 - Migrating forwards to 0008_blah_blah.
 > anotherapp:0001_initial
FATAL ERROR - The following SQL query failed: ALTER TABLE "anotherapp_othermodel" ADD CONSTRAINT "creator_id_refs_id_cff6fecf" FOREIGN KEY ("creator_id") REFERENCES "myuser" ("id") DEFERRABLE INITIALLY DEFERRED;
The error was: relation "myuser" does not exist

Error in migration: anotherapp:0001_initial
DatabaseError: relation "myuser" does not exist

Есть идеи?

Ответы на вопрос(1)

Ваш ответ на вопрос