2013-02-14 103 views
3

我的模塊將正確安裝並且所有相關文件都已正確安裝。但數據庫表沒有被創建。Magento模塊SQL不運行

我跟着this教程。

我的配置xml如下。

<?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> 

我有一個名爲/sql/mygateway_setup/mysql4-install-1.0.0.php的.php文件,但它不運行。

我有什麼企圖

  • 試圖消除從core_resource與我模塊的任何條目
  • 更改版本號
  • 配套配件的版本號

我怎樣才能解決這個問題?

回答

0

首先改變每一個字在XML喜歡小寫(到。第二件事是在你的XML創建模型,如

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

       </entities> 
      </mygateway_mysql4> 

的詳細信息和循序漸進的過程,你可以學習這些文章Link1Link2

希望它可以解決你的問題

1

按照管理面板下面的步驟。

運行編譯器:

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

重新索引的數據:

聯繫=>系統=>索引管理=>

檢查所有的複選框,並在提交右上角的下拉單擊「重新索引數據」。

+0

做這個過程的目的是什麼?請解釋您是否可以 – Techie 2013-02-14 06:13:23

+0

Me在滿足此類問題的同時使用數據庫表定製模塊。因此,我已經對管理面板中的數據進行了索引。數據重建索引後,表格被創建..你試試這個。 – 2013-02-14 06:15:28