Doctrine 1
  1. Doctrine 1
  2. DC-793

import->listTableColumns / export->alterTableSql issues

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.2
    • Fix Version/s: None
    • Component/s: Import/Export
    • Labels:
      None
    • Environment:
      MySQL 5.1, PHP 5.3.1, Doctrine 1.2 branch latest.

      Description

      I am not sure where to lay the blame for the following issue. I am using import->listTableColumns() to get the metadata of existing tables. I am then changing the name of the the columns in the tables retrieved using export->alterTable()... in general this seems to be working perfectly ok except for MYSQL LONGTEXT type fields. listTableColumns is returning the following schema:

      'pn_value' =>
      array
      'name' => string 'pn_value' (length=8)
      'type' => string 'string' (length=6)
      'alltypes' =>
      array
      0 => string 'string' (length=6)
      1 => string 'clob' (length=4)
      'ntype' => string 'longtext' (length=8)
      'length' => null
      'fixed' => boolean false
      'unsigned' => boolean false
      'values' =>
      array
      empty
      'primary' => boolean false
      'default' => null
      'notnull' => boolean false
      'autoincrement' => boolean false

      And when I send this to export->alterTable() it's generating the following SQL
      ALTER TABLE z_module_vars CHANGE pn_value z_value VARCHAR(255)

      So you can see it's truncating the field. The schema returned from the import of column definitions seems strange since there are two alltypes - and I wonder if that is why alterTables just assumes a string of 255 characters?

      So I'm not sure which is to blame, if the import is returning invalid data, or that alterTableSql ultimately misinterprets it, but, the end result is an incorrect ALTER command.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Karma Dordrak (Drak)
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: