1

config.xml:

<config>
 <modules>
 <ASD_MyhProductImporter>
 <version>0.0.1</version>
 </ASD_MyhProductImporter>
 </modules>
 <global>
 <models>
 <myproductimporter>
 <class>ASD_MyProductImporter_Model</class>
 </myproductimporter>
 </models>
 <resources>
 <myproductimporter_setup>
 <setup>
 <module>ASD_MyProductImporter</module>
 <class>Mage_Core_Model_Resource_Setup</class>
 </setup>
 <connection>
 <use>core_setup</use>
 </connection>
 </myproductimporter_setup>
...

The script:

/* @var $installer Mage_Core_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$installer->run("CREATE TABLE 'custom_options' (
'config_id' INT(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
'scope' VARCHAR(8) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
'scope_id' INT(11) NOT NULL DEFAULT '0',
'template_id' INT(3) NOT NULL ,
'value' TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
PRIMARY KEY ('config_id','scope','scope_id','template_id')
) ENGINE = INNODB;"
);
$installer->endSetup();

The myproductimporter_setup row in the core_config_data is not present.

The table that I am trying to create also does not exist.

asked May 21, 2014 at 9:45
2
  • 1
    what about the core_resource does that have an entry? Commented May 21, 2014 at 9:46
  • 1
    It was present yes, with a wrong version (strange, because there were no install/upgrade scripts in the module). I deleted it and ran the installation again. It works. :) Commented May 21, 2014 at 9:52

2 Answers 2

3

Check to make sure there is no entry in the table core_resource.

If there is a entry with a value greater than or equal to the version that you are trying to run then the script will not run.

If there is no entry make sure that your script contains the string install, if you are increasing the entry make sure your script contains the string upgrade.

answered May 21, 2014 at 9:55
2

I think David Was right.

in config.xml <myproductimporter_setup> should be match with YourModul\sql\myproductimporter_setup. Please check your solution.

answered May 21, 2014 at 10:13

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.