#27267: Migrations: Need API to drop a foreign key constraint --------------------------------+-------------------------------------- Reporter: Melvyn Sopacua | Owner: nobody Type: Uncategorized | Status: new Component: Migrations | Version: 1.8 Severity: Normal | Resolution: Keywords: | Triage Stage: Unreviewed Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 --------------------------------+-------------------------------------- Changes (by Melvyn Sopacua):
* version: 1.10 => 1.8 Comment: Updated version. This may be a 1.8 issue. Just ran into the same beast, different trigger. I renamed a primary key and runs into the foreign key constraint: {{{#!python migrations.RenameField( model_name='itemtype', old_name='item_id', new_name='item_type_id', ), }}} Output: {{{ django.db.utils.InternalError: cannot drop constraint dpe_itemtype_pkey on table dpe_itemtype because other objects depend on it DETAIL: constraint dpe_it_itemtype_ptr_id_3b50b94341daa361_fk_dpe_itemtype_item_id on table dpe_itemtypepage depends on index dpe_itemtype_pkey constraint dpe_itemb_item_type_id_5c80224be6efb2ca_fk_dpe_itemtype_item_id on table dpe_itembase depends on index dpe_itemtype_pkey HINT: Use DROP ... CASCADE to drop the dependent objects too. }}} -- Ticket URL: <https://code.djangoproject.com/ticket/27267#comment:3> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/072.1c6d0b375538f3c7a33a7931d125d4eb%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.