Magento Module SQL does not run

半城伤御伤魂 提交于 2020-01-04 01:53:05

问题


My module will setup correctly and all the relavant files are installed correctly. But the database tables are not being created.

I have followed this tutorial.

My config xml is as below.

<?xml version="1.0"?>
<config>
  <modules>
    <Myname_Mygateway>
      <version>1.0.0</version>
    </Myname_Mygateway>
  </modules>
  <global>
    <resources>

      <Mygateway_setup>
        <setup>
          <module>Myname_Mygateway</module>
        </setup>
        <connection>
          <use>core_setup</use>
        </connection>
      </Mygateway_setup>


      <Mygateway_write>
        <connection>
          <use>core_write</use>
        </connection>
      </Mygateway_write>

      <Mygateway_read>
        <connection>
          <use>core_read</use>
        </connection>
      </Mygateway_read>

    </resources>
    <models>
      <mygateway>
        <class>Myname_Mygateway_Model</class>
      </mygateway>
    </models>
    <helpers>
      <mygateway>
        <class>Myname_Mygateway_Helper</class>
      </mygateway>
    </helpers>
    <blocks>
      <mygateway>
        <class>Myname_Mygateway_Block</class>
      </mygateway>
    </blocks>
  </global>
  <default>
    <payment>
      <mygateway>
        <model>mygateway/standard</model>
        <active>1</active>
        <order_status>pending</order_status>
        <title>My Gateway</title>
        <payment_action>sale</payment_action>
        <allowspecific>0</allowspecific>
        <sort_order>1</sort_order>
      </mygateway>
    </payment>
  </default>
  <frontend>
    <routers>
      <mygateway>
        <use>standard</use>
        <args>
          <module>Myname_Mygateway</module>
          <frontName>mygateway</frontName>
        </args>
      </mygateway>
    </routers>
  </frontend>
</config>

I have a .php file named /sql/mygateway_setup/mysql4-install-1.0.0.php but it does not run.

What have I tried

  • Tried removing any entries from core_resource related to my module
  • Changing version numbers
  • Matchin version numbers

How can I fix this issue?


回答1:


First of all change every word to lower case in your xml like ( to .second thing is to create models in your xml like

           <mygateway_mysql4>
                <class>Mygateway_Model_Mysql4</class>
                <entities>
                    <mygateway>
                        <table>mygateway</table>
                    </mygateway>

                </entities>
            </mygateway_mysql4>

for details and step by step process you can study these articles Link1, Link2.

Hope it solve your problem




回答2:


Follow the below steps to in admin panel.

Run The Compiler :

Admin => System => Tools => Compilation > Enable => Run Compilation Process.

Re index the Data :

Admin => System => Index Management =>

Check all the check box and click "Re Index Data" in drop-down in top right to submit.



来源:https://stackoverflow.com/questions/14868228/magento-module-sql-does-not-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!