have one question, recently I was developing one module with a lot of tables in DB, and concept was changing often, so was need to change existing tables in DB, and I noticed difference in table creating script and table upgrading. Here you go. Look at creating table code below:
$table = $installer->getConnection()
->newTable($installer->getTable('module/table'))
->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, 9, array(
'nullable' => false,
'primary' => true,
'identity' => true,
'auto_increment' => true
)
);
the newTable() function returns instance of Varien_Db_Ddl_Table And upgrading table script uses different way to add new column to existing table, take a look:
$installer->getConnection()
->addColumn($tableName, 'test', array(
'nullable' => false,
'length' => 9,
'type' => Varien_Db_Ddl_Table::TYPE_INTEGER,
'comment' => 'Test Field'
)
)
these two addColumn functions are different and also they are methods of different classes, and they make me sad every time I need to change syntax.
So here is question, is there way to update existing table using instance of the Varien_Db_Ddl_Table class?