0

Trying to build my first magento plugin i still am new to the structure and coding. Now the problem is my database table is not being created. I dont know why my database table is not being created.I tried numerous tutorials and stack over flow, still have not been able to figure out. any help

heres my config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Envato_CustomConfig>
            <version>0.0.1</version>
        </Envato_CustomConfig>
    </modules>
    <global>
        <helpers>
            <customconfig>
                <class>Envato_CustomConfig_Helper</class>
            </customconfig>
        </helpers>
        <models>
             <customconfig>
                <class>Envato_CustomConfig_Model</class>
             </customconfig>
        </models>
    </global>
    <adminhtml>
        <acl>
            <resources>
                <customconfig_setup>
                    <setup>
                         <module>Envato_CustomConfig</module>
                    </setup>
                    <connection>
                      <use>core_setup</use>
                    </connection>
                 </customconfig_setup>
                <customconfig_write>
                    <connection>
                        <use>core_write</use>
                    </connection>
                </customconfig_write>
               <customconfig_read>
                  <connection>
                     <use>core_read</use>
                  </connection>
               </customconfig_read>              
                <admin>
                    <children>
                        <system>
                            <children>
                                <config>
                                    <children>
                                        <customconfig_options>
                                            <title>Email Configuration Section</title>
                                        </customconfig_options>
                                    </children>
                                </config>
                            </children>
                        </system>
                    </children>
                </admin>
            </resources>
        </acl>
    </adminhtml>
</config>

Heres my installer script

<?php

$installer = $this;

$installer->startSetup();

$installer->run("

-- DROP TABLE IF EXISTS {$this->getTable('nfrsuper_awesome_example')};
CREATE TABLE {$this->getTable('nfrsuper_awesome_example')} (
  `id` int(11) unsigned NOT NULL auto_increment,
  `name` varchar(100) NOT NULL,
  `description` varchar(100) NOT NULL,
  `other` varchar(100) NOT NULL,
  PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

INSERT INTO {$this->getTable('nfrsuper_awesome_example')} (name, description, other) values ('Example 1', 'Example One Description', 'This first example is reall awesome.');
INSERT INTO {$this->getTable('nfrsuper_awesome_example')} (name, description, other) values ('Example 2', 'Example Two Description', 'This second example is reall awesome.');
INSERT INTO {$this->getTable('nfrsuper_awesome_example')} (name, description, other) values ('Example 3', 'Example Three Description', 'This third example is reall awesome.');
INSERT INTO {$this->getTable('nfrsuper_awesome_example')} (name, description, other) values ('Example 4', 'Example Four Description', 'This fourth example is reall awesome.');

");

$installer->endSetup();

1 Answer 1

1

Your config.xml is messed up... the resources belong under global like this

<?xml version = "1.0"?>
<config>
    <modules>
        <Envato_CustomConfig>
            <version>0.0.1</version>
        </Envato_CustomConfig>
    </modules>
    <global>
        <helpers>
            <customconfig>
                <class>Envato_CustomConfig_Helper</class>
            </customconfig>
        </helpers>
        <models>
            <customconfig>
                <class>Envato_CustomConfig_Model</class>
            </customconfig>
        </models>
        <resources>
            <customconfig_setup>
                <setup>
                    <module>Envato_CustomConfig</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </customconfig_setup>
            <customconfig_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </customconfig_write>
            <customconfig_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </customconfig_read>
        </resources>
    </global>
    <adminhtml>
        <acl>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <customconfig_options>
                                        <title>Email Configuration Section</title>
                                    </customconfig_options>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </acl>
    </adminhtml>
</config>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.