Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-359

[GH-211] Fix dropping foreign key multiple times with test


    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Labels:


      This issue is created automatically through a Github pull request on behalf of sdepablos:



      In some cases the Comparator class returns multiple drops for the same foreign key.
      Specifically, in case you have two tables, A & B, with A having a foreign key FK
      referencing B, if you drop table B, the resulting diff shows this FK twice,
      once on the diff->orphanedForeignKeys array as we're deleting B, and another on
      the diff->changedTables array as table A is also being modified. As a result of this you
      get the DROP FOREIGN KEY instruction twice in the final SQL.

      I'm not really sure if this change should be done in the Comparator clas or if it's better to
      receive the full diff, even with duplicated drops for FK and later, when generating the final
      SQL, drop the unnecessary ones


        Benjamin Eberlei created issue -
        Benjamin Eberlei added a comment -

        A related Github Pull-Request [GH-211] was closed

        Benjamin Eberlei added a comment - A related Github Pull-Request [GH-211] was closed
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to failed: Error in remote call to 'FishEye 0 (' ( [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DBAL-359, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)


          • Assignee:
            Benjamin Eberlei
            Benjamin Eberlei
          • Votes:
            0 Vote for this issue
            1 Start watching this issue


            • Created: