Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-479

Doctrine2 schema-tool:update doesn't re-create foreign keys on entity change

    Details

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

      Description

      I have changed a @ManyToOne relation to another entity. My workflow was this:

      • Having @ManyToOne(targetEntity="Entity\EntityA") in the source
      • Creating the database schema
      • Changing @ManyToOne(targetEntity="Entity\EntityA") to @ManyToOne(targetEntity="Entity\EntityB")
      • Calling doctrine orm:schema-tool:update

      orm:schema-tool:update doesn't notice that and doesn't re-create the FK on MySQL and PostgreSQL (haven't tested others).

        Issue Links

          Activity

          Timo A. Hummel created issue -
          Guilherme Blanco made changes -
          Field Original Value New Value
          Link This issue is duplicated by DDC-1585 [ DDC-1585 ]
          Benjamin Eberlei made changes -
          Workflow jira [ 13340 ] jira-feedback [ 14008 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback [ 14008 ] jira-feedback2 [ 15872 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 15872 ] jira-feedback3 [ 18128 ]
          Benjamin Eberlei made changes -
          Project Doctrine 2 - ORM [ 10032 ] Doctrine DBAL [ 10040 ]
          Key DDC-1586 DBAL-479
          Affects Version/s 2.1.5 [ 10167 ]
          Affects Version/s 2.1.5 [ 10170 ]
          Component/s Tools [ 10015 ]
          Benjamin Eberlei made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 2.3 [ 10184 ]
          Resolution Fixed [ 1 ]

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Timo A. Hummel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: