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.

2
  • 1
    what about the core_resource does that have an entry? – David Manners May 21 '14 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. :) – Syspect May 21 '14 at 9:52
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.

2

I think David Was right.

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

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.