Tôi có một ứng dụng (chúng ta hãy gọi nó là MyApp) trong một dự án Django 1.5. MyApp định nghĩa một mô hình người dùng tùy chỉnh (MyUser). Dự án sử dụng một ứng dụng khác (AnotherApp) tham chiếu đến MyUser. Các trường tham chiếu MyApp trong AnotherApp.Django phụ thuộc vòng tròn phía nam
Mọi thứ đều hoạt động tốt trên máy tính xách tay phát triển của tôi. Tôi đang cố gắng triển khai dự án của mình trên máy chủ và khi tôi chuyển sang bước di chuyển, MyApp không thành công do phụ thuộc vào AnotherApp và AnotherApp không thành công trên MyApp (tôi đã thử di chuyển ứng dụng độc lập). Cả hai đều không thành công trong lần di chuyển đầu tiên tương ứng của chúng (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
Bất kỳ ý tưởng nào?
Có một (đóng) vé cho vấn đề này (http://south.aeracode.org/ticket/390) có thảo luận tốt về chủ đề. –