0

I have made some changes in my custom module to enable store view field and made a upgrade file to create table to store store id data as follows. but its not working. its not even giving me an error.

$installer = $this;
$installer->startSetup();
$table = $installer->getConnection()
    ->newTable($installer->getTable('custom/expert_store'))
    ->addColumn('expert_id',Varien_Db_Ddl_Table::TYPE_SMALLINT,null,
        array(
            'nullable'  => false,
            'primary'   => true,
        ),
        'Expert ID'
    )
    ->addColumn('store_id',Varien_Db_Ddl_Table::TYPE_SMALLINT,null,
        array(
            'unsigned'  => true,
            'nullable'  => false,
            'primary'   => true,
        ),
        'Store ID'
    )
    ->addIndex($installer->getIdxName(
            'custom/expert_store',
            array('store_id')
        ),
        array('store_id')
    )
    ->addForeignKey(
        $installer->getFkName(
            'custom/expert_store',
            'expert_id',
            'custom/expert',
            'entity_id'
        ),
        'expert_id',
        $installer->getTable('custom/expert'),
        'entity_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE,
        Varien_Db_Ddl_Table::ACTION_CASCADE
    )
    ->addForeignKey(
        $installer->getFkName(
            'custom/expert_store',
            'store_id',
            'core/store',
            'store_id'
        ),
        'store_id',
        $installer->getTable('core/store'),
        'store_id',
        Varien_Db_Ddl_Table::ACTION_CASCADE,
        Varien_Db_Ddl_Table::ACTION_CASCADE
    )
    ->setComment('Expert To Store Linkage Table');
$installer->getConnection()->createTable($table);
$installer->endSetup(); 
0

Have you tried refreshing the system cache?

Sometimes this helps, if an update Script is not triggered.

If i ran into this issue, i flush all caches and indexes.

If it isn't working after cache/index refresh - do you have the upgrade script named correct with the module versions upgrade-{old module version}-{new module version}.php ?

| improve this answer | |
  • yes I did it multiple times. – Vikram May 18 '16 at 13:17
  • upgrade-1.0.0-1.0.1.php and in config 1.0.1 – Vikram May 18 '16 at 13:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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