2

I have created a custom module. But When Install it does not create any table. And It does not show any error. But It makes a link in admin panel. When I click on it, It shows error like

'custom_magento.cm_fabric_icons' doesn't exist

.

sql setup file.

$installer = $this;
$table = $installer->getConnection()
    ->newTable($installer->getTable('fabric_icons/icons'))
    ->addColumn('icons_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'unsigned' => true,
        'identity' => true,
        'nullable' => false,
        'primary'  => true,
    ), 'Entity id')
    ->addColumn("title", Varien_Db_Ddl_Table::TYPE_TEXT, null, array( 'nullable' => true),"Title")
    ->addColumn("slim_fit_title", Varien_Db_Ddl_Table::TYPE_TEXT, null, array( 'nullable' => true),"Slim Fit Title")
    ->addColumn("slim_fit_image", Varien_Db_Ddl_Table::TYPE_TEXT, null, array( 'nullable' => true),"Slim Fit Image")
    ->addColumn("normal_fit_title", Varien_Db_Ddl_Table::TYPE_TEXT, null, array( 'nullable' => true),"Normal Fit Title")
    ->addColumn("normal_fit_image", Varien_Db_Ddl_Table::TYPE_TEXT, null, array( 'nullable' => true),"Normal Fit Image")
    ->setComment("Fabric Icons");
$installer->getConnection()->createTable($table);

data setup file,

$installer = $this;
$model = Mage::getModel('fabric_icons/icons');
$dataRows = array(
                                array(
                                "icons_id" => "1"
                                ,"title" => "Tool Design Icons"
                                ,"slim_fit_title" => "Slim Fit"
                                ,"slim_fit_image" => "m_normal.png"
                                ,"normal_fit_title" => "Normal Fit"
                                ,"normal_fit_image" => "m_normal_1.png"
                                )
              );
foreach ($dataRows as $data) {
    $model->setData($data)->setOrigData()->save();
}
  • can you please tell,the name of sql,data sql – Amit Bera Mar 3 '15 at 14:02
2

@Pradeep Sanku Answer match for your needs.

Delete Package_module record from the core_resource Table and refresh your current working script your browser.Script will executed once again and table will automatically regenerated into your database.

2

Most likely causes are:

  1. Your sql files are named incorrectly.
  2. The configuration in your config.xml is incorrect.
  3. Your module existed in core_resource before you added the information to the script.

I can't really comment on the first two as you didn't include that information. You can confirm if it's the 3rd by looking for your module name in core_resource. If the row exists, you can remove it, clear the cache and refresh to attempt to re-trigger the install script.

  • I did not see the third comment. If I saw, I would accept it as answer. +1 vote for your answer. – Vivek Aasaithambi Mar 4 '15 at 6:19

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.