startSetup(); /** * Drop indexes */ $installer->getConnection()->dropIndex( $installer->getTable('sendfriend/sendfriend'), 'IDX_REMOTE_ADDR' ); $installer->getConnection()->dropIndex( $installer->getTable('sendfriend/sendfriend'), 'IDX_LOG_TIME' ); /** * Change columns */ $tables = array( $installer->getTable('sendfriend/sendfriend') => array( 'columns' => array( 'log_id' => array( 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, 'comment' => 'Log ID' ), 'ip' => array( 'type' => Varien_Db_Ddl_Table::TYPE_BIGINT, 'length' => 20, 'unsigned' => true, 'nullable' => false, 'default' => '0', 'comment' => 'Customer IP address' ), 'time' => array( 'type' => Varien_Db_Ddl_Table::TYPE_INTEGER, 'unsigned' => true, 'nullable' => false, 'default' => '0', 'comment' => 'Log time' ), 'website_id' => array( 'type' => Varien_Db_Ddl_Table::TYPE_SMALLINT, 'unsigned' => true, 'nullable' => false, 'default' => '0', 'comment' => 'Website ID' ) ), 'comment' => 'Send to friend function log storage table', 'engine' => 'InnoDB' ) ); $installer->getConnection()->modifyTables($tables); /** * Add indexes */ $installer->getConnection()->addIndex( $installer->getTable('sendfriend/sendfriend'), $installer->getIdxName('sendfriend/sendfriend', array('ip')), array('ip') ); $installer->getConnection()->addIndex( $installer->getTable('sendfriend/sendfriend'), $installer->getIdxName('sendfriend/sendfriend', array('time')), array('time') ); $installer->endSetup();