sales_flat_order
is the full name of the table
and so you have to use alias in $installer->getTable()
In $installer->getTable()
parameter like module_alias/table_alias.
In that case try with
$installer->getTable('sales/order')
When you write this it will return table name sales_flat_order
because
module_alias = sales
table_alias = order
EDIT
You can use below script to add new column. It works fine in my system
$installer = $this;
$installer->startSetup();
$installer->getConnection()
->addColumn($installer->getTable('sales/order'),'custom_value', array(
'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
'nullable' => false,
'length' => 255,
'after' => null, // column name to insert new column after
'comment' => 'Title'
));
$installer->endSetup();
I am using Varien_Db_Ddl_Table::TYPE_TEXT
insted of Varien_Db_Ddl_Table::TYPE_VARCHAR
because TYPE_VARCHAR
is deprecated
You can check @ Varien_Db_Adapter_Pdo_Mysql::$_ddlColumnTypes
And If you specify type TYPE_TEXT
but set length to lets say 255
Magento will create a MySQL
column of VARCHAR
type.
Best Answer
Take a look at this: https://stackoverflow.com/questions/10074358/how-to-increase-maximum-size-of-csv-field-in-magento-where-is-this-located
Apparently you have to manually change the type of the field but it seems risky. One of the answers claims to have done it without any problems though.
Alternatively, you could try to estimate if your field will really need more space. MySQL type TEXT can fit a bit over 65, 000 characters.