Uploaded image for project: 'Doctrine DBAL'
  1. Doctrine DBAL
  2. DBAL-837

Cannot drop index needed in a foreign key constraint

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.4.2
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      MariaDB version 10.0.7
      InnoDB version 5.6.10
      doctrine/orm version v2.4.1
      doctrine/dbal version v2.4.2

      Description

      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:

      DROP INDEX IDX_DCE815B325C79A8C ON moveMembers;
      ALTER TABLE moveMembers DROP fkAccessId;

      When I use --force to execute it I get the following error:

      [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

        Issue Links

          Activity

          Hide
          cmodijk Cliff Odijk added a comment -

          Maybe related to DBAL-732?

          Show
          cmodijk Cliff Odijk added a comment - Maybe related to DBAL-732 ?

            People

            • Assignee:
              deeky666 Steve Müller
              Reporter:
              cmodijk Cliff Odijk
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: