Personal I'm trying to create an installation script for magento module, but the problem is that he's not running my script and not save the core_resource table, anyone have any idea why that is?
I followed the following tutorial Magento – Install, install upgrade, data and data upgrade scripts
Config:
<?xml version="1.0"?>
<config>
<modules>
<Inchoo_DBScript>
<version>3.1.5.6</version>
</Inchoo_DBScript>
</modules>
<global>
<models>
<inchoo_dbscript>
<class>Inchoo_DBScript_Model</class>
<resourceModel>inchoo_dbscript_resource</resourceModel>
</inchoo_dbscript>
<inchoo_dbscript_resource>
<class>Inchoo_DBScript_Model_Resource</class>
<entities>
<ticket>
<table>inchoo_dbscript_ticket</table>
</ticket>
<comment>
<table>inchoo_dbscript_comment</table>
</comment>
</entities>
</inchoo_dbscript_resource>
</models>
<resources>
<inchoo_dbscript_setup>
<setup>
<module>Inchoo_DBScript</module>
</setup>
</inchoo_dbscript_setup>
</resources>
</global>
</config>
sql\inchoo_dbscript_setup\install-3.1.5.6.php:
$installer = $this; $installer->startSetup(); $table = $installer->getConnection() ->newTable($installer->getTable('inchoo_dbscript/ticket')) ->addColumn('ticket_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, ), 'Id') ->addColumn('title', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array( 'nullable' => false, ), 'Title') ->addColumn('description', Varien_Db_Ddl_Table::TYPE_TEXT, null, array( 'nullable' => false, ), 'Description'); $installer->getConnection()->createTable($table); $table = $installer->getConnection() ->newTable($installer->getTable('inchoo_dbscript/comment')) ->addColumn('comment_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array( 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, ), 'Id') ->addColumn('comment', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array( 'nullable' => false, ), 'Comment'); $installer->getConnection()->createTable($table); $installer->endSetup();
app\etc\modules\Inchoo_DBScript.xml:
<config>
<modules>
<Inchoo_DBScript>
<active>true</active>
<codePool>community</codePool>
</Inchoo_DBScript>
</modules>
</config>
core_resource
table for your extension. If there's an entry in there for yourinchoo_dbscript_setup
resource in means Magento already thinks its installed.