Affects Version/s: 1.2.2
Fix Version/s: None
Environment:MySQL 5.1, PHP 5.3.1, Doctrine 1.2 branch latest.
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:
'name' => string 'pn_value' (length=8)
'type' => string 'string' (length=6)
0 => string 'string' (length=6)
1 => string 'clob' (length=4)
'ntype' => string 'longtext' (length=8)
'length' => null
'fixed' => boolean false
'unsigned' => boolean false
'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.