Upgrade script multiple columns magento

This tutorial explains how to upgrade script multiple columns magento. The code below show to add columns to existing custom table magento module.

Please also refer other magento tutorials and how to create custom tables magento installer script.


Upgrade script multiple columns magento

Upgrade script multiple columns magento

<?php
$installer = $this;
$installer->startSetup();
 
$installer->getConnection()
    ->addColumn($installer->getTable('imagedetail'),'filters_workshop_colour', 
        array(
        'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
        'nullable' => true,
        'comment' => 'Filters Workshop Colour'
    ));
$installer->getConnection()
    ->addColumn($installer->getTable('imagedetail'),'splashbackcolor', 
        array(
        'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
        'nullable' => true,
        'comment' => 'Splash Back Color'
        ));
$installer->getConnection()
    ->addColumn($installer->getTable('imagedetail'),'cabinetcolor', 
        array(
        'type' => Varien_Db_Ddl_Table::TYPE_TEXT,
        'nullable' => true,
        'comment' => 'Cabinet Color'
        ));
        

$installer->endSetup();
?>

Upgrade magento table

Upgrade script multiple columns magento

Click here to download the upgrade script and the config file.

Please also refer other magento tutorials and how to create custom tables magento installer script.

Share this Tutorial

Leave a Reply

Your email address will not be published. Required fields are marked *

*