0

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

enter image description here

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>
  • yes I got same problem in my module..please help us – Keyul Shah Dec 20 '13 at 12:13
  • I'd start by checking the core_resource table for your extension. If there's an entry in there for your inchoo_dbscript_setup resource in means Magento already thinks its installed. – Alan Storm Dec 20 '13 at 20:35
0

This script working fine. May be you have some mistake. Check again following issue.

  1. Clear cache
  2. Your module need have proper permission(like read+write+execute permission)

Now run!

Enjoy coding :)

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.