Monday, September 28, 2015

Drop constrailts

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.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/0f20a0ce-22c6-4623-b164-0044dce8f612%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment