2

I am working on a Magento ver. 1.11.2.0 (enterprise).

I am following Allan Storm's Post here.

My modules config.xml :

<?xml version="1.0"?>
<config>
<modules>
    <Invent_Instance>
        <version>0.1</version>
    </Invent_Instance>
</modules>
<global>
    <models>
        <instance>
            <class>Invent_Instance_Model</class>
            <resourceModel>instance_mysql4</resourceModel>
        </instance>
        <instance_mysql4>
            <class>Invent_Instance_Model_Mysql4</class>
            <entities>
                <instance>
                    <table>instance</table>
                </instance>
            </entities>
        </instance_mysql4>
    </models>
    <resources>
        <instance_setup>
            <setup>
                <module>Invent_Instance</module>
                <class>Invent_Instance_Model_Resource_Mysql4_Setup</class>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
        </instance_setup>
        <instance_write>
            <connection>
                <use>core_write</use>
            </connection>
        </instance_write>
        <instance_read>
            <connection>
                <use>core_read</use>
            </connection>
        </instance_read>
    </resources>

...

The class Invent_Instance_Model_Resource_Mysql4_Setup seems to be called ok as before i created it, it gave out an error saying it doesnt exist.

My files structure looks like :

Module file structure

with the contents of my installer being

echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
die("Exit for now");

after removing all cache, i reload my admin module and it loads without giving output or obviously without running this script.

Can someone please show my what im doing wrong? I have double check the module version number (0.1) and cant figure out why its not running.

Is there anything wrong with my modules model setup? thanks for any assistance here!

1 Answer 1

4

Looking at the above everything there seems fine.

It is worth checking the core_resource table and look for instance_setup in the "code" column if the value in the "value" column matches the version number in the config.xml then the script won't be run.

You can always delete this row to run the install script again.

Sign up to request clarification or add additional context in comments.

2 Comments

ah ofcourse! cant believe i missed that, thanks very much im going to try that right now, seeing i just altered tables manually and need this correctly as to allow for upgrades ofcourse. will let you know in a bit. thanks again.
this has happened to me several times. Sometimes it is the most obvious answer!

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.