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.
-
1what about the core_resource does that have an entry?David Manners– David Manners2014年05月21日 09:46:08 +00:00Commented May 21, 2014 at 9:46
-
1It 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. :)Syspect– Syspect2014年05月21日 09:52:51 +00:00Commented May 21, 2014 at 9:52
2 Answers 2
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.
I think David Was right.
in config.xml <myproductimporter_setup> should be match with YourModul\sql\myproductimporter_setup. Please check your solution.
Explore related questions
See similar questions with these tags.