Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-592

doctrine:schema:update keeps droping and recreating the same index

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.4
    • Fix Version/s: 2.4.2
    • Component/s: None
    • Security Level: All
    • Labels:
      None
    • Environment:
      mysql Ver 14.14 Distrib 5.5.32, for debian-linux-gnu (x86_64) using readline 6.2

      Description

      The title says it all.

      Anytime I run the doctrine:schema:update command, the last 2 lines of the sql output are to drop and recreate the same index (foreign key)

      ALTER TABLE ordersdomains DROP FOREIGN KEY FK_D4D861CF8D9F6D38;
      ALTER TABLE ordersdomains ADD CONSTRAINT FK_D4D861CF8D9F6D38 FOREIGN KEY (order_id) REFERENCES `order` (id) ON DELETE CASCADE
      

        Activity

        Hide
        mikeSimonson added a comment -

        The code that trigger the problem.

        /**
             * @ORM\ManyToMany(targetEntity="Domain", cascade={"all"})
             * @ORM\JoinTable(name="ordersdomains")
             * @Assert\NotNull()
             **/
            private $domains;
        
        Show
        mikeSimonson added a comment - The code that trigger the problem. /** * @ORM\ManyToMany(targetEntity= "Domain" , cascade={ "all" }) * @ORM\JoinTable(name= "ordersdomains" ) * @Assert\NotNull() **/ private $domains;
        Hide
        Steve Müller added a comment -

        A patch for this issue was supplied in PR: https://github.com/doctrine/dbal/pull/380

        Show
        Steve Müller added a comment - A patch for this issue was supplied in PR: https://github.com/doctrine/dbal/pull/380
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-380] was closed:
        https://github.com/doctrine/dbal/pull/380

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-380] was closed: https://github.com/doctrine/dbal/pull/380

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            mikeSimonson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: