I've been working on a module that needs some attributes added to the table of sales_orders. So i thought i will make an resource install script and add it to the XML. Well for me this wasn't a easy task. To be really honest I cant make it work. I have searched some hours to get the solution, but i haven't found it. The weird thing is that my module isnt at the core_resource table...
Well this is my XML. I'm a bit new to XML editing. Maybe i have made an error.
XML:
<config>
<global>
<modules>
<Sendcloud_Magento>
<version>0.2.0</version>
</Sendcloud_Magento>
</modules>
<helpers>
<magento>
<class>Sendcloud_Magento_Helper</class>
</magento>
</helpers>
<models>
<magento>
<class>Sendcloud_Magento_Model</class>
<resourceModel>magento_resource</resourceModel>
</magento>
<magento_mysql4>
<class>Sendcloud_Magento_Model_Mysql4</class>
</magento_mysql4>
</models>
<resources>
<!-- ... -->
<magento_setup>
<setup>
<module>Sendcloud_Magento</module>
<class>Sendcloud_Magento_Model_Resource_Mysql4_Setup</class>
</setup>
<connection>
<use>core_setup</use>
</connection>
</magento_setup>
<!-- ... -->
</resources>
</global>
<admin>
<routers>
<magento>
<use>admin</use>
<args>
<module>Sendcloud_Magento</module>
<frontName>sendcloud</frontName>
</args>
</magento>
</routers>
</admin>
<adminhtml>
<acl>
<resources>
<all>
<title>Allow Everything</title>
</all>
<admin>
<children>
<system>
<children>
<config>
<children>
<sendcloud>
<title>Sendcloud</title>
</sendcloud>
</children>
</config>
</children>
</system>
</children>
</admin>
</resources>
</acl>
<layout>
<updates>
<magento>
<file>magento.xml</file>
</magento>
</updates>
</layout>
<events>
<core_block_abstract_prepare_layout_before>
<observers>
<magento_core_block_abstract_prepare_layout_before>
<class>Sendcloud_Magento_Model_Observer</class>
<method>addMassAction</method>
</magento_core_block_abstract_prepare_layout_before>
</observers>
</core_block_abstract_prepare_layout_before>
</events>
</adminhtml>
Ive put an installer script in my module. the path /local/Sendcloud/Magento/sql/magento_setup/mysql4-install-0.2.0.php
echo 'Running This Upgrade: '.get_class($this)."\n <br /> \n";
die("Exit for now");
I have an model made in Sendcloud/Magento/Model/Resource/Mysql4/Setup.php
class Sendcloud_Magento_Model_Resource_Mysql4_Setup extends Mage_Core_Model_Resource_Setup {
}
I hope some of you have an solution to my question.
Best regards and a happy new year,
Paul