Doctrine Migrations
  1. Doctrine Migrations
  2. DMIG-44

Migration fails when removing index and a column with that index

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Critical Critical
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:
      Postgres 8.4, Cent OS 5

      Description

      Migration fails:
      SQLSTATE[42704]: Undefined object: 7 ERROR: index "idx_dae7c08213b1f670" does not exist

      under these conditions:
      1. Remove the index definition (indexes={@index(columns=

      {"col"}

      )})
      2. Remove the column definiton on '$col'

      What happens under the hood:
      1. Column 'col' is dropped and all associated indexes are dropped automatically by the database
      2. Doctrine tries to drop the index on 'col' which was already dropped.
      3. Things blow up.

      Possible solutions:
      1. Append 'IF Exists' clause to 'drop index' command.
      2. Rework the sequence of schema diffs, so that indexes are dropped before the columns are dropped

      1. Cell.php
        0.3 kB
        Ilya Biryukov

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Ilya Biryukov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: