Doctrine 1
  1. Doctrine 1
  2. DC-830

Migration for up() not adding suffix for index

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Migrations
    • Labels:
      None
    • Environment:
      Postgresql 8.4 / Symfony 1.4.6

      Description

      I am still getting the same issue as previously closed a while ago on trac http://trac.doctrine-project.org/ticket/1964

      migration.php
      <?php
      /**
       * This class has been auto-generated by the Doctrine ORM Framework
       */
      class Add_Category_Slug_Index extends Doctrine_Migration_Base
      {
          public function up()
          {
              $this->addIndex('category', 'category_sluggable', array(
                   'fields' => 
                   array(
                    0 => 'slug',
                   ),
                   'type' => 'unique',
                   ));
          }
      
          public function down()
          {
              $this->removeIndex('category', 'category_sluggable', array(
                   'fields' => 
                   array(
                    0 => 'slug',
                   ),
                   'type' => 'unique',
                   ));
          }
      }
      

      The above migration generates an index named category_sluggable instead of category_sluggable_idx

        Activity

        webPragmatist created issue -
        webPragmatist made changes -
        Field Original Value New Value
        Description I am still getting the same issue as previously closed a while ago on trac http://trac.doctrine-project.org/ticket/1964

        {code:title=migration.php}
        <?php
        /**
         * This class has been auto-generated by the Doctrine ORM Framework
         */
        class Add_Category_Slug_Index extends Doctrine_Migration_Base
        {
            public function up()
            {
                $this->addIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }

            public function down()
            {
                $this->removeIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }
        }
        {code}

        The above migration generates the an index named *category_sluggable* instead of *category_sluggable_idx*
        I am still getting the same issue as previously closed a while ago on trac http://trac.doctrine-project.org/ticket/1964


        {code:title=migration.php}
        <?php
        /**
         * This class has been auto-generated by the Doctrine ORM Framework
         */
        class Add_Category_Slug_Index extends Doctrine_Migration_Base
        {
            public function up()
            {
                $this->addIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }

            public function down()
            {
                $this->removeIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }
        }
        {code}

        The above migration generates the an index named *category_sluggable* instead of *category_sluggable_idx*
        webPragmatist made changes -
        Environment Postgresql 8.4 Postgresql 8.4 / Symfony 1.4.6
        Description I am still getting the same issue as previously closed a while ago on trac http://trac.doctrine-project.org/ticket/1964


        {code:title=migration.php}
        <?php
        /**
         * This class has been auto-generated by the Doctrine ORM Framework
         */
        class Add_Category_Slug_Index extends Doctrine_Migration_Base
        {
            public function up()
            {
                $this->addIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }

            public function down()
            {
                $this->removeIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }
        }
        {code}

        The above migration generates the an index named *category_sluggable* instead of *category_sluggable_idx*
        I am still getting the same issue as previously closed a while ago on trac http://trac.doctrine-project.org/ticket/1964

        {code:title=migration.php}
        <?php
        /**
         * This class has been auto-generated by the Doctrine ORM Framework
         */
        class Add_Category_Slug_Index extends Doctrine_Migration_Base
        {
            public function up()
            {
                $this->addIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }

            public function down()
            {
                $this->removeIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }
        }
        {code}

        The above migration generates the an index named *category_sluggable* instead of *category_sluggable_idx*
        webPragmatist made changes -
        Description I am still getting the same issue as previously closed a while ago on trac http://trac.doctrine-project.org/ticket/1964

        {code:title=migration.php}
        <?php
        /**
         * This class has been auto-generated by the Doctrine ORM Framework
         */
        class Add_Category_Slug_Index extends Doctrine_Migration_Base
        {
            public function up()
            {
                $this->addIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }

            public function down()
            {
                $this->removeIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }
        }
        {code}

        The above migration generates the an index named *category_sluggable* instead of *category_sluggable_idx*
        I am still getting the same issue as previously closed a while ago on trac http://trac.doctrine-project.org/ticket/1964

        {code:title=migration.php}
        <?php
        /**
         * This class has been auto-generated by the Doctrine ORM Framework
         */
        class Add_Category_Slug_Index extends Doctrine_Migration_Base
        {
            public function up()
            {
                $this->addIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }

            public function down()
            {
                $this->removeIndex('category', 'category_sluggable', array(
                     'fields' =>
                     array(
                      0 => 'slug',
                     ),
                     'type' => 'unique',
                     ));
            }
        }
        {code}

        The above migration generates an index named *category_sluggable* instead of *category_sluggable_idx*
        Hide
        webPragmatist added a comment -

        If I change the name in the up() to category_sluggable_idx both up and down work properly.

        Show
        webPragmatist added a comment - If I change the name in the up() to category_sluggable_idx both up and down work properly.
        Hide
        Jakub Argasiński added a comment -

        Confirming. I had the same problem last week and as a workaround I had to change suffix from "%s_idx" to "%s". Even if the bug is not reproducible in a test case, it indeed happens in live environment on PostgreSQL (in my case, Symphony is not used).

        Show
        Jakub Argasiński added a comment - Confirming. I had the same problem last week and as a workaround I had to change suffix from "%s_idx" to "%s". Even if the bug is not reproducible in a test case, it indeed happens in live environment on PostgreSQL (in my case, Symphony is not used).

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

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

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            webPragmatist
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: