I need to create a new tabel while creating a custom extension in magento. In that case no table is creating and default magento error page is showing. I am giving my code here..Please let me know where did i go wrong. File:/app/code/local/Somnath/Test/sql/test_setup/install-1.6.0.0.php
$installer = $this;
/* @var $installer Mage_Core_Model_Resource_Setup */
$installer->startSetup();
$installer->run("
-- DROP TABLE IF EXISTS {$this->getTable('somnath_test')};
CREATE TABLE {$this->getTable('somnath_test')} (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fname` varchar(100) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
");
$installer->endSetup();
My config.xml file is
<config>
<modules>
<Somnath_Test>
<version>1.0.0</version>
</Somnath_Test>
</modules>
<frontend>
<routers>
<routeurfrontend>
<use>standard</use>
<args>
<module>Somnath_Test</module>
<frontName>test</frontName>
</args>
</routeurfrontend>
</routers>
<layout>
<updates>
<test>
<file>test.xml</file>
</test>
</updates>
</layout>
<strong><events>
<page_block_html_topmenu_gethtml_before>
<observers>
<Somnath_Test>
<class>somnath_test/observer</class>
<method>addToTopmenu</method>
</Somnath_Test>
</observers>
</page_block_html_topmenu_gethtml_before>
</events>
</strong>
</frontend>
<admin>
<routers>
<test>
<use>admin</use>
<args>
<module>Somnath_Test</module>
<frontName>admintest</frontName>
</args>
</test>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<test>
<file>test.xml</file>
</test>
</updates>
</layout>
<menu>
<test translate="title" module="adminhtml">
<title>My plugins</title>
<sort_order>100</sort_order>
<children>
<set_time>
<title>Contact Email</title>
<action>admintest/adminhtml_index</action>
</set_time>
</children>
</test>
</menu>
</adminhtml>
<global>
<blocks>
<test>
<class>Somnath_Test_Block</class>
</test>
</blocks>
<models>
<test>
<class>Somnath_Test_Model</class>
<resourceModel>test_mysql4</resourceModel>
</test>
<test_mysql4>
<class>Somnath_Test_Model_Mysql4</class>
<entities>
<test>
<table>somnath_test</table>
</test>
</entities>
</test_mysql4>
</models>
<resources>
<test_setup>
<setup>
<module>Somnath_Test</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</test_setup>
<test_write>
<connection>
<use>core_write</use>
</connection>
</test_write>
<test_read>
<connection>
<use>core_read</use>
</connection>
</test_read>
</resources>
</global>
</config>
i am trying to build a extension for contact us.My config file is given above and the sql file contents the code above.I have done exactly what is needed to create new table but nothing works.
i can not created table for my custom module. How to create table for my custom module..?Please advice me..