trouble in create custom table for custom modelI just can't tell what is wrong with this Model code that save() is raising an exception.||Model Class FallthroughAccess custom tableUpgrade to 1.9.2.2 - Base table or view already exists: 1050 Table 'mage_permission_variable' already existsCreate a Model for a custom table#1005 - Can't create table 'smartools.sales_flat_quote_item' (errno: -1)adding a image/logo to attributeTruncate table using resource model in Magento 2What and why is the proper way to load a modelinvalid create method

How does Ehrenfest's theorem apply to the quantum harmonic oscillator?

For which categories of spectra is there an explicit description of the fibrant objects via lifting properties?

Why does Central Limit Theorem break down in my simulation?

What problems would a superhuman have who's skin is constantly hot?

Would an aboleth's Phantasmal Force lair action be affected by Counterspell, Dispel Magic, and/or Slow?

How can I get players to focus on the story aspect of D&D?

Do items de-spawn?

Do I really need to have a scientific explanation for my premise?

Conservation of Mass and Energy

Vocabulary for giving just numbers, not a full answer

Haman going to the second feast dirty

Signed and unsigned numbers

How to draw dashed arc of a circle behind pyramid?

What is better: yes / no radio, or simple checkbox?

What ability score modifier does a javelin's damage use?

After `ssh` without `-X` to a machine, is it possible to change `$DISPLAY` to make it work like `ssh -X`?

Can I use a violin G string for D?

How do we create new idioms and use them in a novel?

Why restrict private health insurance?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Can we track matter through time by looking at different depths in space?

How do spaceships determine each other's mass in space?

How can I manipulate the output of Information?

Help find my computational error for logarithms



trouble in create custom table for custom model


I just can't tell what is wrong with this Model code that save() is raising an exception.||Model Class FallthroughAccess custom tableUpgrade to 1.9.2.2 - Base table or view already exists: 1050 Table 'mage_permission_variable' already existsCreate a Model for a custom table#1005 - Can't create table 'smartools.sales_flat_quote_item' (errno: -1)adding a image/logo to attributeTruncate table using resource model in Magento 2What and why is the proper way to load a modelinvalid create method













0















I get some trouble in auto create table for model . I create module 'rewardpoint' by moduleCreator and it generate rewardpoint model automatically,But i want to create new Model 'rate' in my module . So , this is my code :



-config.xml



<models>
<rate>
<class>Magestore_Rewardpoint_Model</class>
<resourceModel>rate_mysql4</resourceModel>
</rate>
<rate_mysql4>
<class>Magestore_Rewardpoint_Model_Mysql4</class>
<entities>
<rate>
<table>rewardpoints_rate</table>
</rate>
</entities>
</rate_mysql4>
</models>
<resources>
<rewardpoint_setup>
<setup>
<module>Magestore_Rewardpoint</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</rewardpoint_setup>
<rewardpoint_write>
<connection>
<use>core_write</use>
</connection>
</rewardpoint_write>
<rewardpoint_read>
<connection>
<use>core_read</use>
</connection>
</rewardpoint_read>
</resources>


And in sql folder , i change code too



$installer = $this;

$installer->startSetup();

/**
* create rewardpoint table
*/
$installer->run("

DROP TABLE IF EXISTS $this->getTable('rewardpoints_rate');

CREATE TABLE $this->getTable('rewardpoints_rate') (
`rate_id` int(11) unsigned NOT NULL auto_increment,
`direction` smallint(6) NOT NULL,
`point` int(11) NOT NULL,
`money` int(11) NOT NULL,
`customer_group` varchar(20) NOT NULL ,
PRIMARY KEY (`rate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");


Then i refesh browser and see my phpadmin result , there's no table name 'rewardpoints_rate'.










share|improve this question
























  • Please read magento.stackexchange.com/questions/428/… to learn how to debug. I would think you have a caching problem. And if this is your complete config.xml you might have missed the point with XML?

    – Fabian Blechschmidt
    Oct 5 '14 at 6:44















0















I get some trouble in auto create table for model . I create module 'rewardpoint' by moduleCreator and it generate rewardpoint model automatically,But i want to create new Model 'rate' in my module . So , this is my code :



-config.xml



<models>
<rate>
<class>Magestore_Rewardpoint_Model</class>
<resourceModel>rate_mysql4</resourceModel>
</rate>
<rate_mysql4>
<class>Magestore_Rewardpoint_Model_Mysql4</class>
<entities>
<rate>
<table>rewardpoints_rate</table>
</rate>
</entities>
</rate_mysql4>
</models>
<resources>
<rewardpoint_setup>
<setup>
<module>Magestore_Rewardpoint</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</rewardpoint_setup>
<rewardpoint_write>
<connection>
<use>core_write</use>
</connection>
</rewardpoint_write>
<rewardpoint_read>
<connection>
<use>core_read</use>
</connection>
</rewardpoint_read>
</resources>


And in sql folder , i change code too



$installer = $this;

$installer->startSetup();

/**
* create rewardpoint table
*/
$installer->run("

DROP TABLE IF EXISTS $this->getTable('rewardpoints_rate');

CREATE TABLE $this->getTable('rewardpoints_rate') (
`rate_id` int(11) unsigned NOT NULL auto_increment,
`direction` smallint(6) NOT NULL,
`point` int(11) NOT NULL,
`money` int(11) NOT NULL,
`customer_group` varchar(20) NOT NULL ,
PRIMARY KEY (`rate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");


Then i refesh browser and see my phpadmin result , there's no table name 'rewardpoints_rate'.










share|improve this question
























  • Please read magento.stackexchange.com/questions/428/… to learn how to debug. I would think you have a caching problem. And if this is your complete config.xml you might have missed the point with XML?

    – Fabian Blechschmidt
    Oct 5 '14 at 6:44













0












0








0








I get some trouble in auto create table for model . I create module 'rewardpoint' by moduleCreator and it generate rewardpoint model automatically,But i want to create new Model 'rate' in my module . So , this is my code :



-config.xml



<models>
<rate>
<class>Magestore_Rewardpoint_Model</class>
<resourceModel>rate_mysql4</resourceModel>
</rate>
<rate_mysql4>
<class>Magestore_Rewardpoint_Model_Mysql4</class>
<entities>
<rate>
<table>rewardpoints_rate</table>
</rate>
</entities>
</rate_mysql4>
</models>
<resources>
<rewardpoint_setup>
<setup>
<module>Magestore_Rewardpoint</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</rewardpoint_setup>
<rewardpoint_write>
<connection>
<use>core_write</use>
</connection>
</rewardpoint_write>
<rewardpoint_read>
<connection>
<use>core_read</use>
</connection>
</rewardpoint_read>
</resources>


And in sql folder , i change code too



$installer = $this;

$installer->startSetup();

/**
* create rewardpoint table
*/
$installer->run("

DROP TABLE IF EXISTS $this->getTable('rewardpoints_rate');

CREATE TABLE $this->getTable('rewardpoints_rate') (
`rate_id` int(11) unsigned NOT NULL auto_increment,
`direction` smallint(6) NOT NULL,
`point` int(11) NOT NULL,
`money` int(11) NOT NULL,
`customer_group` varchar(20) NOT NULL ,
PRIMARY KEY (`rate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");


Then i refesh browser and see my phpadmin result , there's no table name 'rewardpoints_rate'.










share|improve this question
















I get some trouble in auto create table for model . I create module 'rewardpoint' by moduleCreator and it generate rewardpoint model automatically,But i want to create new Model 'rate' in my module . So , this is my code :



-config.xml



<models>
<rate>
<class>Magestore_Rewardpoint_Model</class>
<resourceModel>rate_mysql4</resourceModel>
</rate>
<rate_mysql4>
<class>Magestore_Rewardpoint_Model_Mysql4</class>
<entities>
<rate>
<table>rewardpoints_rate</table>
</rate>
</entities>
</rate_mysql4>
</models>
<resources>
<rewardpoint_setup>
<setup>
<module>Magestore_Rewardpoint</module>
</setup>
<connection>
<use>core_setup</use>
</connection>
</rewardpoint_setup>
<rewardpoint_write>
<connection>
<use>core_write</use>
</connection>
</rewardpoint_write>
<rewardpoint_read>
<connection>
<use>core_read</use>
</connection>
</rewardpoint_read>
</resources>


And in sql folder , i change code too



$installer = $this;

$installer->startSetup();

/**
* create rewardpoint table
*/
$installer->run("

DROP TABLE IF EXISTS $this->getTable('rewardpoints_rate');

CREATE TABLE $this->getTable('rewardpoints_rate') (
`rate_id` int(11) unsigned NOT NULL auto_increment,
`direction` smallint(6) NOT NULL,
`point` int(11) NOT NULL,
`money` int(11) NOT NULL,
`customer_group` varchar(20) NOT NULL ,
PRIMARY KEY (`rate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

");


Then i refesh browser and see my phpadmin result , there's no table name 'rewardpoints_rate'.







database model resource-model






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 23 mins ago









Teja Bhagavan Kollepara

2,98641947




2,98641947










asked Oct 5 '14 at 3:25









freeman167freeman167

316




316












  • Please read magento.stackexchange.com/questions/428/… to learn how to debug. I would think you have a caching problem. And if this is your complete config.xml you might have missed the point with XML?

    – Fabian Blechschmidt
    Oct 5 '14 at 6:44

















  • Please read magento.stackexchange.com/questions/428/… to learn how to debug. I would think you have a caching problem. And if this is your complete config.xml you might have missed the point with XML?

    – Fabian Blechschmidt
    Oct 5 '14 at 6:44
















Please read magento.stackexchange.com/questions/428/… to learn how to debug. I would think you have a caching problem. And if this is your complete config.xml you might have missed the point with XML?

– Fabian Blechschmidt
Oct 5 '14 at 6:44





Please read magento.stackexchange.com/questions/428/… to learn how to debug. I would think you have a caching problem. And if this is your complete config.xml you might have missed the point with XML?

– Fabian Blechschmidt
Oct 5 '14 at 6:44










3 Answers
3






active

oldest

votes


















1














I would like to add this as a comment, but then it is unreadable.



You don't need all the XML nodes, because magento adds them automatically:



<resources>
<rewardpoint_setup>
<connection>
<use>core_setup</use>
</connection>
</rewardpoint_setup>
<rewardpoint_write>
<connection>
<use>core_write</use>
</connection>
</rewardpoint_write>
<rewardpoint_read>
<connection>
<use>core_read</use>
</connection>
</rewardpoint_read>




You can remove them if you want.






share|improve this answer






























    0














    For run sql_setup you need define resource



    <resources>
    <rate_setup>
    <setup>
    <module>Magestore_Rewardpoint</module>
    </setup>
    <connection>
    <use>core_setup</use>
    </connection>
    </rate_setup>
    <rate_read>
    <connection>
    <use>core_read</use>
    </connection>
    </rate_read>
    <rate_write>
    <connection>
    <use>core_write</use>
    </connection>
    </rate_write>
    </resources>





    share|improve this answer























    • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

      – freeman167
      Oct 6 '14 at 3:13


















    0














    Also try this



    <?xml version="1.0"?>
    <config>
    <modules>
    <Magestore_Rewardpoint>
    <version>0.1.0</version>
    </Magestore_Rewardpoint>
    </modules>
    <global>
    <helpers>
    <rewardpoint>
    <class>Magestore_Rewardpoint_Helper</class>
    </rewardpoint>
    </helpers>
    <resources>
    <rewardpoint_setup>
    <setup>
    <module>Magestore_Rewardpoint</module>
    </setup>
    <connection>
    <use>core_setup</use>
    </connection>
    </rewardpoint_setup>
    <rewardpoint_write>
    <connection>
    <use>core_write</use>
    </connection>
    </rewardpoint_write>
    <rewardpoint_read>
    <connection>
    <use>core_read</use>
    </connection>
    </rewardpoint_read>
    </resources>
    </global>
    </config>


    Also try this code for appcodelocalMagestoreRewardpointsqlrewardpoint_setupmysql4-install-0.1.0.php



    <?php
    $installer = $this;
    $installer->startSetup();
    $sql=<<<SQLTEXT
    create table rewardpoints_rate('rate_id' int(11) unsigned NOT NULL auto_increment, 'direction' smallint(6) NOT NULL,'point` int(11) NOT NULL,'money' int(11) NOT NULL, 'customer_group' varchar(20) NOT NULL , PRIMARY KEY ('rate_id'));
    SQLTEXT;

    $installer->run($sql);

    $installer->endSetup();


    Hope this will work for you






    share|improve this answer























    • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

      – freeman167
      Oct 6 '14 at 3:14










    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f37993%2ftrouble-in-create-custom-table-for-custom-model%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    I would like to add this as a comment, but then it is unreadable.



    You don't need all the XML nodes, because magento adds them automatically:



    <resources>
    <rewardpoint_setup>
    <connection>
    <use>core_setup</use>
    </connection>
    </rewardpoint_setup>
    <rewardpoint_write>
    <connection>
    <use>core_write</use>
    </connection>
    </rewardpoint_write>
    <rewardpoint_read>
    <connection>
    <use>core_read</use>
    </connection>
    </rewardpoint_read>




    You can remove them if you want.






    share|improve this answer



























      1














      I would like to add this as a comment, but then it is unreadable.



      You don't need all the XML nodes, because magento adds them automatically:



      <resources>
      <rewardpoint_setup>
      <connection>
      <use>core_setup</use>
      </connection>
      </rewardpoint_setup>
      <rewardpoint_write>
      <connection>
      <use>core_write</use>
      </connection>
      </rewardpoint_write>
      <rewardpoint_read>
      <connection>
      <use>core_read</use>
      </connection>
      </rewardpoint_read>




      You can remove them if you want.






      share|improve this answer

























        1












        1








        1







        I would like to add this as a comment, but then it is unreadable.



        You don't need all the XML nodes, because magento adds them automatically:



        <resources>
        <rewardpoint_setup>
        <connection>
        <use>core_setup</use>
        </connection>
        </rewardpoint_setup>
        <rewardpoint_write>
        <connection>
        <use>core_write</use>
        </connection>
        </rewardpoint_write>
        <rewardpoint_read>
        <connection>
        <use>core_read</use>
        </connection>
        </rewardpoint_read>




        You can remove them if you want.






        share|improve this answer













        I would like to add this as a comment, but then it is unreadable.



        You don't need all the XML nodes, because magento adds them automatically:



        <resources>
        <rewardpoint_setup>
        <connection>
        <use>core_setup</use>
        </connection>
        </rewardpoint_setup>
        <rewardpoint_write>
        <connection>
        <use>core_write</use>
        </connection>
        </rewardpoint_write>
        <rewardpoint_read>
        <connection>
        <use>core_read</use>
        </connection>
        </rewardpoint_read>




        You can remove them if you want.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Oct 5 '14 at 6:46









        Fabian BlechschmidtFabian Blechschmidt

        33.4k664173




        33.4k664173























            0














            For run sql_setup you need define resource



            <resources>
            <rate_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rate_setup>
            <rate_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rate_read>
            <rate_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rate_write>
            </resources>





            share|improve this answer























            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:13















            0














            For run sql_setup you need define resource



            <resources>
            <rate_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rate_setup>
            <rate_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rate_read>
            <rate_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rate_write>
            </resources>





            share|improve this answer























            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:13













            0












            0








            0







            For run sql_setup you need define resource



            <resources>
            <rate_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rate_setup>
            <rate_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rate_read>
            <rate_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rate_write>
            </resources>





            share|improve this answer













            For run sql_setup you need define resource



            <resources>
            <rate_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rate_setup>
            <rate_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rate_read>
            <rate_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rate_write>
            </resources>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 5 '14 at 3:37









            Amit BeraAmit Bera

            58.9k1575175




            58.9k1575175












            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:13

















            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:13
















            i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

            – freeman167
            Oct 6 '14 at 3:13





            i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

            – freeman167
            Oct 6 '14 at 3:13











            0














            Also try this



            <?xml version="1.0"?>
            <config>
            <modules>
            <Magestore_Rewardpoint>
            <version>0.1.0</version>
            </Magestore_Rewardpoint>
            </modules>
            <global>
            <helpers>
            <rewardpoint>
            <class>Magestore_Rewardpoint_Helper</class>
            </rewardpoint>
            </helpers>
            <resources>
            <rewardpoint_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rewardpoint_setup>
            <rewardpoint_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rewardpoint_write>
            <rewardpoint_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rewardpoint_read>
            </resources>
            </global>
            </config>


            Also try this code for appcodelocalMagestoreRewardpointsqlrewardpoint_setupmysql4-install-0.1.0.php



            <?php
            $installer = $this;
            $installer->startSetup();
            $sql=<<<SQLTEXT
            create table rewardpoints_rate('rate_id' int(11) unsigned NOT NULL auto_increment, 'direction' smallint(6) NOT NULL,'point` int(11) NOT NULL,'money' int(11) NOT NULL, 'customer_group' varchar(20) NOT NULL , PRIMARY KEY ('rate_id'));
            SQLTEXT;

            $installer->run($sql);

            $installer->endSetup();


            Hope this will work for you






            share|improve this answer























            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:14















            0














            Also try this



            <?xml version="1.0"?>
            <config>
            <modules>
            <Magestore_Rewardpoint>
            <version>0.1.0</version>
            </Magestore_Rewardpoint>
            </modules>
            <global>
            <helpers>
            <rewardpoint>
            <class>Magestore_Rewardpoint_Helper</class>
            </rewardpoint>
            </helpers>
            <resources>
            <rewardpoint_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rewardpoint_setup>
            <rewardpoint_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rewardpoint_write>
            <rewardpoint_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rewardpoint_read>
            </resources>
            </global>
            </config>


            Also try this code for appcodelocalMagestoreRewardpointsqlrewardpoint_setupmysql4-install-0.1.0.php



            <?php
            $installer = $this;
            $installer->startSetup();
            $sql=<<<SQLTEXT
            create table rewardpoints_rate('rate_id' int(11) unsigned NOT NULL auto_increment, 'direction' smallint(6) NOT NULL,'point` int(11) NOT NULL,'money' int(11) NOT NULL, 'customer_group' varchar(20) NOT NULL , PRIMARY KEY ('rate_id'));
            SQLTEXT;

            $installer->run($sql);

            $installer->endSetup();


            Hope this will work for you






            share|improve this answer























            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:14













            0












            0








            0







            Also try this



            <?xml version="1.0"?>
            <config>
            <modules>
            <Magestore_Rewardpoint>
            <version>0.1.0</version>
            </Magestore_Rewardpoint>
            </modules>
            <global>
            <helpers>
            <rewardpoint>
            <class>Magestore_Rewardpoint_Helper</class>
            </rewardpoint>
            </helpers>
            <resources>
            <rewardpoint_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rewardpoint_setup>
            <rewardpoint_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rewardpoint_write>
            <rewardpoint_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rewardpoint_read>
            </resources>
            </global>
            </config>


            Also try this code for appcodelocalMagestoreRewardpointsqlrewardpoint_setupmysql4-install-0.1.0.php



            <?php
            $installer = $this;
            $installer->startSetup();
            $sql=<<<SQLTEXT
            create table rewardpoints_rate('rate_id' int(11) unsigned NOT NULL auto_increment, 'direction' smallint(6) NOT NULL,'point` int(11) NOT NULL,'money' int(11) NOT NULL, 'customer_group' varchar(20) NOT NULL , PRIMARY KEY ('rate_id'));
            SQLTEXT;

            $installer->run($sql);

            $installer->endSetup();


            Hope this will work for you






            share|improve this answer













            Also try this



            <?xml version="1.0"?>
            <config>
            <modules>
            <Magestore_Rewardpoint>
            <version>0.1.0</version>
            </Magestore_Rewardpoint>
            </modules>
            <global>
            <helpers>
            <rewardpoint>
            <class>Magestore_Rewardpoint_Helper</class>
            </rewardpoint>
            </helpers>
            <resources>
            <rewardpoint_setup>
            <setup>
            <module>Magestore_Rewardpoint</module>
            </setup>
            <connection>
            <use>core_setup</use>
            </connection>
            </rewardpoint_setup>
            <rewardpoint_write>
            <connection>
            <use>core_write</use>
            </connection>
            </rewardpoint_write>
            <rewardpoint_read>
            <connection>
            <use>core_read</use>
            </connection>
            </rewardpoint_read>
            </resources>
            </global>
            </config>


            Also try this code for appcodelocalMagestoreRewardpointsqlrewardpoint_setupmysql4-install-0.1.0.php



            <?php
            $installer = $this;
            $installer->startSetup();
            $sql=<<<SQLTEXT
            create table rewardpoints_rate('rate_id' int(11) unsigned NOT NULL auto_increment, 'direction' smallint(6) NOT NULL,'point` int(11) NOT NULL,'money' int(11) NOT NULL, 'customer_group' varchar(20) NOT NULL , PRIMARY KEY ('rate_id'));
            SQLTEXT;

            $installer->run($sql);

            $installer->endSetup();


            Hope this will work for you







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 5 '14 at 18:02









            Dharmen GunawatDharmen Gunawat

            15610




            15610












            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:14

















            • i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

              – freeman167
              Oct 6 '14 at 3:14
















            i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

            – freeman167
            Oct 6 '14 at 3:14





            i fixed it , its because this module has run before . so i have to delete its cache from core_resource . thank you

            – freeman167
            Oct 6 '14 at 3:14

















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f37993%2ftrouble-in-create-custom-table-for-custom-model%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

            Fil:Tokke komm.svg

            Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?