Mohammed Sufian
Mohammed Sufian

Reputation: 1781

install script not working magento 1.9

first step disabled the cache... done...

below is my file hierarchy:

enter image description here

this is my config.xml at app/code/community/Foggyline/HappyHour/etc/config.xml

<?xml version="1.0"?>
 <config>
<modules>
    <Foggyline_HappyHour>
        <version>1.0.0.0</version>
    </Foggyline_HappyHour>
</modules>
<frontend>
    <routers>
        <foggyline_happyhour>
            <use>standard</use>
            <args>
                <module>Foggyline_HappyHour</module>
                <frontName>happyhour</frontName>
            </args>
        </foggyline_happyhour>
    </routers>
</frontend>
<global>
    <blocks>
        <foggyline_happyhour>
            <class>Foggyline_HappyHour_Block</class>
        </foggyline_happyhour>
    </blocks>
    <models>
        <foggyline_happyhour>
            <class>Foggyline_HappyHour_Model</class>
            <resourceModel>foggyline_happyhour_resource</resourceModel>
        </foggyline_happyhour>
        <foggyline_happyhour_resource>
            <class>Foggyline_HappyHour_Model_Resource</class>
            <entities>
                <user>
                    <table>foggyline_happyhour_user</table>
                </user>
            </entities>
        </foggyline_happyhour_resource>
    </models>
    <resources>
        <foggyline_happyhour_setup>
            <setup>
                <model>Foggyline_HappyHour</model>
            </setup>
            <connection>
                <use>core_setup</use>
            </connection>
            <foggyline_happyhour_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </foggyline_happyhour_write>
            <foggyline_happyhour_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </foggyline_happyhour_read>
        </foggyline_happyhour_setup>
    </resources>
</global>
</config>

and my install script at app/code/community/Foggyline/HappyHour/sql/foggyline_happyhour_setup/install-1.0.0.0.php

and also tried renaming the install-1.0.0.0.php to mysql4-install-1.0.0.0.php but not woring..

 /* @var $installer Mage_Core_Model_Resource_Setup */

  $installer = $this;
  $installer->startSetup();
  $table = $installer->getConnection()
    ->newTable($installer->getTable('foggyline_happyhour/user'))
    ->addColumn('user_id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identify' => true,
        'unsigned' => true,
        'nullable' => false,
        'primary' => true)
            , 'Id')
    ->addColumn('first_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
        'nullable' => false
            )
            , 'First Name')
    ->addColumn('last_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, null, array(
        'nullable' => false
            )
            , 'Last Name')
    ->setComment('Foggyline_HappyHour User Entity');

 $installer->getConnection()->createTable($table);
 $installer->endSetup();

now when i refesh my store or visit any page of my store.. nothing is getting into mysql.. the core_resource table does not have any entry as foggyline_happyhour_setup with version 1.0.0.0 , i also tried clearing cache /var/cache any help or suggestion would be a great help thanks in advance...

i am new to magento.. and still learning it.. so that i could become a magento developer...

Upvotes: 1

Views: 3141

Answers (4)

Sverre J&#248;rn
Sverre J&#248;rn

Reputation: 139

Had this problem too

2016-03-14T19:50:08+00:00 ERR (3): Warning: simplexml_load_string(): resourceModel&gt;

Had a newline in the config.xml after

</resourceModel

So, check everything for spaces and newlines. And... Enable magento logs and verbose errors on index.php.

Another thing. When you remove the core_resource table entry, be sure to delete foggyline_happyhour_user too... If not you will get a There has been an error processing your request.

Upvotes: 1

user3201200
user3201200

Reputation: 1

Please change <model>Foggyline_HappyHour</model> to <module>Foggyline_HappyHour</module>. Their documentation is also wrong.

Upvotes: 0

Sveta Oksen
Sveta Oksen

Reputation: 401

Check that you dont have the node <skip_process_modules_updates>1</skip_process_modules_updates> in your local.xml

Upvotes: 1

Sunil Patel
Sunil Patel

Reputation: 536

Please add read and write permission for resource.

<resources>
<foggyline_happyhour_setup>
        <setup>
            <module>Foggyline_HappyHour</module>
        </setup>
        <connection>
            <use>core_setup</use>
        </connection>
</foggyline_happyhour_setup>
<foggyline_happyhour_write>
        <connection>
            <use>core_write</use>
        </connection>
</foggyline_happyhour_write>
<foggyline_happyhour_read>
    <connection>
        <use>core_read</use>
    </connection>
</foggyline_happyhour_read> 

Now you need to remove resource entry from core_resource and then remove cache and try to check.

Upvotes: 2

Related Questions