0

I am trying to write a upgrade script but unfortunately I am getting an error that says

Fatal error: Class Varien_Db_Dbl_Table not found in mysql4-upgrade-1.0.1-1.0.2.php on line 7.

Here is my code

<?php
$installer = $this;
$installer->startSetup();

$table = $installer->getConnection()
    ->newTable($installer->getTable('abhi_gallery/gallery'))
    ->addColumn('id', Varien_Db_Dbl_Table::TYPE_INTEGER, null,
        array(
            'identity' => true,
            'unsigned' => true,
            'nullable' => false,
            'primary'  => true,
        ), 'Value id')
    ->addColumn('cms_page_id', Varien_Db_Dbl_Table::TYPE_INTEGER, null,
        array(
            'nullable' => false,
        ), 'Cms page id')
    ->addColumn('position', Varien_Db_Dbl_Table::TYPE_INTEGER, null,
        array(
            'unsigned' => true,
            'nullable' => true,
        ), 'Position')
    ->addColumn('file', Varien_Db_Dbl_Table::TYPE_INTEGER, 255,
        array(
            'nullable' => false,
        ), 'File Name')
    ->addColumn('label', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255,
        array(
            'nullable' => true,
        ), 'Label')
    ->addColumn('is_disabled', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null,
        array(
            'nullable' => true,
        ), 'Is Disabled');

$installer->getConnection()->createTable( $table );

$installer->getConnection()->addForeignKey(
    $installer->getFkName(
        'abhi_gallery/gallery',
        'cms_page_id',
        'cms/page',
        'page_id'
    ),
    $installer->getTable('abhi_gallery/gallery'),
    'cms_page_id',
    $installer->getTable('cms/page'),
    'page_id'
);
$installer->endSetup();
?>

closed as off-topic by sv3n, Keyur Shah, Manoj Deswal, liyakat, Prince Patel Jan 22 '18 at 4:44

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – sv3n, Keyur Shah, Manoj Deswal, liyakat, Prince Patel
If this question can be reworded to fit the rules in the help center, please edit the question.

  • you don't need that Varien_Db_Ddl_Table because you already assiging $table once again to connection->newTable() – padhiyar gaurang Oct 9 '17 at 12:59
  • add your config.xml file – Murtuza Zabuawala Oct 9 '17 at 13:48
3

Please check your update script for typos ... error says

Varien_Db_Dbl_Table

that really does not exist, it should be

Varien_Db_Ddl_Table

(_Ddl_ instead of _Dbl_)

  • 2
    I spent 5 - 7 min to this question and I am not able to find diff between b and d , great – Murtuza Zabuawala Oct 9 '17 at 14:34
  • 3
    Happens. Sometimes the problem is in front of the screen :P – sv3n Oct 9 '17 at 14:39

Not the answer you're looking for? Browse other questions tagged or ask your own question.