Drop constrailts

25 views
Skip to first unread message

Григорий Крамаренко

unread,
Sep 28, 2015, 11:12:26 PM9/28/15
to Django users
In migrations I need delete constraints before creating table-partitioning.
But Django generates different constraint names on different servers.
On server 1:
ALTER TABLE "order_autoselect" ADD CONSTRAINT "order_autoselec_summary_id_1d623f742c26ae09_fk_order_summary_id" FOREIGN KEY ("summary_id") REFERENCES "order_summary" ("id") DEFERRABLE INITIALLY DEFERRED;

On server 2:
ALTER TABLE "order_autoselect" ADD CONSTRAINT "order_autoselect_summary_id_2c26ae09_fk_order_summary_id" FOREIGN KEY ("summary_id") REFERENCES "order_summary" ("id") DEFERRABLE INITIALLY DEFERRED;


Version 1.8.4 uses on all servers.

The application is written for multiple installations in different organizations and on different servers.
Before, in version 1.4, the constraints were created without hashes and were really unique. And we could write one SQL script which will be executed after the command "syncdb" and will 100% work everywhere. Attempt to migrate the app to a new Django version 1.8 turned into such problems.

How make it? Or is it a bug in Django? Thanks.

Tim Graham

unread,
Sep 29, 2015, 9:45:52 AM9/29/15
to Django users
Reply all
Reply to author
Forward
0 new messages