Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20429

eZOracle - db_schema.dba upgrade check fails on custom tables with auto_increment fields

    Details

      Description

      Upgrade check feature returns false errors in the presence of custom named tables/sequences, if these tables include auto_increment fields and the implementer does not name the tables has "ez"something.

      In ezoracle/doc/developer-notes.txt is explained that

      "The sequences made for oracle start with s_ instead of ez. The reason for
      this is the 30 character limitation: if _s was appended to the table names
      the identifier would exceed this value. Instead ez at the start is replaced
      with s_."
      

      Considering that implementers are encouraged to name their custom tables using a sufix that identifies their company, this limitation should not be hardcoded as such.

      Steps to reproduce
      • create a ezoracle table, named *mytable*, and include an auto_increment field
      • upgrade check feature, in admin portal setup tab, will report that the sequence is missing, no matter what how you name it

      Until there's an official solution for this constraint, a viable workaround might be:

      • name your custom tables ez<something> and the correspondent sequences s_<something>

        Activity

        Hide
        Felix Woldt added a comment - - edited

        To reproduce this you have to create the db_schema.dba file for 'mytable'
        located for example in extension/myextension/share/db_schema.dba
        and than do upgrade check.

        <code>
        <?php
        // This array contains the database schema
        $schema = array (
          'mytable' =>
          array (
            'name' => 'mytable',
            'fields' =>
            array (
              'id' =>
              array (
                'type' => 'auto_increment',
                'default' => false,
              ),
            ),
            'indexes' =>
            array (
              'PRIMARY' =>
              array (
                'type' => 'primary',
                'fields' =>
                array (
                  0 => 'id',
                ),
              ),
            ),
          ),
          
          '_info' =>
          array (
            'format' => 'generic',
          ),
        );
         
        ?>
        

        Show
        Felix Woldt added a comment - - edited To reproduce this you have to create the db_schema.dba file for 'mytable' located for example in extension/myextension/share/db_schema.dba and than do upgrade check. <code> <?php // This array contains the database schema $schema = array ( 'mytable' => array ( 'name' => 'mytable', 'fields' => array ( 'id' => array ( 'type' => 'auto_increment', 'default' => false, ), ), 'indexes' => array ( 'PRIMARY' => array ( 'type' => 'primary', 'fields' => array ( 0 => 'id', ), ), ), ), '_info' => array ( 'format' => 'generic', ), );   ?>

          People

          • Assignee:
            Unassigned
            Reporter:
            Joaquim Cavalleri (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: