DBAL-837: Cannot drop index needed in a foreign key constraint #2072

Open
doctrinebot opened this Issue Mar 17, 2014 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user cmodijk:

I'm trying to remove an relation from an entity and i'm getting an error that it could not be executed. After testing it, it's missing the DROP FOREIGN KEY query.

The generated SQL is:
{quote}
DROP INDEX IDX_DCE815B325C79A8C ON moveMembers;
ALTER TABLE moveMembers DROP fkAccessId;
{quote}

When I use --force to execute it I get the following error:
{quote}
[Doctrine\DBAL\DBALException]

An exception occurred while executing 'DROP INDEX IDX_DCE815B325C79A8C ON moveMembers':

SQLSTATE[HY000]: General error: 1553 Cannot drop index 'IDX_DCE815B325C79A8C': needed in a foreign key constraint

[PDOException]

SQLSTATE[HY000]: General error: 1553 Cannot drop index 'IDX_DCE815B325C79A8C': needed in a foreign key constraint

{quote}

@doctrinebot

Comment created by cmodijk:

Maybe related to DBAL-732?

@doctrinebot doctrinebot added the Bug label Dec 7, 2015
@deeky666 deeky666 was assigned by doctrinebot Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment