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

eZDBSchemaInterface subclasses do not allow to dump/rebuild a proper schema: table columns are always sorted

    XMLWordPrintable

Details

    Description

      When using the ezsqldumpschema.php script to migrate the eZP schema eg. from mysql to oracle, it is important to preserve as much information as possible.

      Unfortunately there is a snag in the way that table column definitions are exported: always sorted.
      This is fine and dandy as long as the original table cols where sorted (this always happens in eZP, probably as a by-product of this bug), but it does not work anymore with extensions that have columns that are not ordered by their name - typical case: column 'id' being the first. It happens eg. with ezflow tables, and with ezfind 2.1 too.

      The end result is that the aformentioned script and class cannot be used to reliably move eZP databases from one site to another - while it is considered bad practice to have SQL that depends on colum order (and code based on ezpersistentobj does not), there might be some code in extensions that does.

      The proposed fix: remove ksort at the end of fetchTableFields - at least if there is a particular option passed to it in the $params options array.
      This way we can still get the old behaviour of sorted table columns without having to verify that the fix breaks schema comparsion or other such stuff...

      Attachments

        Activity

          People

            72f8acac-185f-4a54-9470-a7473f50daab@accounts.ibexa.co Gaetano Giunta
            72f8acac-185f-4a54-9470-a7473f50daab@accounts.ibexa.co Gaetano Giunta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: