Doctrine 1
  1. Doctrine 1
  2. DC-929

createIndexSql and dropIndexSql don't use the same logic to get the index name

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Migrations
    • Labels:
      None
    • Environment:
      Postgresql 8.4, Symfony 1.4, Doctrine 1.2

      Description

      In the class Doctrine_Export the functions for creating and dropping indexes do not use the same logic to get the name of the index to be created or dropped.
      When creating an index $this->conn->quoteIdentifier() is called on the index name.
      When dropping an index $this->conn->quoteIdentifier($this->conn->formatter->getIndexName()) is called on the name, which by default adds '_idx' to the index name. Hence, when an index should be dropped in a migration an index with that name is not found because it was created without the '_idx'.

        Activity

        Hide
        Lukas Kahwe added a comment -

        looks to me like this is a bug in index creation. then again fixing the bug will lead to potential BC issues. that being said, anyone affected could "simply" set the index format to empty. also "fixing" the names to the proper format does not require shuffeling around data. so imho the right fix would be to apply the drop naming logic in the create logic.

        what surprises me is that the main reason for appending _idx by default was that many RDBMS will otherwise break because they do not separate identifiers between constraints and indexes etc and therefore people run into collisions without the postfix.

        Show
        Lukas Kahwe added a comment - looks to me like this is a bug in index creation. then again fixing the bug will lead to potential BC issues. that being said, anyone affected could "simply" set the index format to empty. also "fixing" the names to the proper format does not require shuffeling around data. so imho the right fix would be to apply the drop naming logic in the create logic. what surprises me is that the main reason for appending _idx by default was that many RDBMS will otherwise break because they do not separate identifiers between constraints and indexes etc and therefore people run into collisions without the postfix.
        Hide
        John Kary added a comment -

        Related/Duplicate of DC-830 and DC-867.

        Show
        John Kary added a comment - Related/Duplicate of DC-830 and DC-867 .

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Lea Haensenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: