Skip to content

Instantly share code, notes, and snippets.

@evgv
Created May 3, 2017 15:25
Show Gist options
  • Select an option

  • Save evgv/fbbba7b8d22f35470c1a1521349352b7 to your computer and use it in GitHub Desktop.

Select an option

Save evgv/fbbba7b8d22f35470c1a1521349352b7 to your computer and use it in GitHub Desktop.
Magento. Modify table column

Modify table column

Change column type from int(11) to bigint(20) with modifyColumn() function from class Varien_Db_Adapter_Pdo_Mysql

$installer = $this;
$installer->startSetup();

$installer->getConnection()->modifyColumn($installer->getTable('webforms/results'), 'customer_ip', array('type' => Varien_Db_Ddl_Table::TYPE_BIGINT));    

// or
// $installer->run("ALTER TABLE {$this->getTable('webforms/results')} MODIFY `customer_ip` BIGINT( 20 ) ;");

$installer->endSetup();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment