2012-11-08 35 views
0

在Joomla 1.5和1.6的擴展清單文件中指定的install.sql文件的用法有什麼區別。升級joomla擴展sql文件沒有得到執行

在1.5中,如果您使用method =「upgrade」並且組件已安裝,則install.sql將執行。

在2.5中,如果使用method =「upgrade」並且組件已安裝,則install.sql不會被執行。

有誰知道這個改變是故意的嗎?

回答

0

這是故意從1.6達到現在是SQL一個更新標籤:

//executed when component is installed for the first time 
<install folder="admin"> 
    <sql> 
     <file driver="mysql" charset="utf8">sql/example.install.sql</file> 
    </sql> 
</install> 


//executed when component is uninstalled 
<uninstall folder="admin"> 
    <sql> 
     <file driver="mysql" charset="utf8">sql/example.uninstall.sql</file> 
    </sql> 
</uninstall> 


//executed when the component is installed over an existing version 
//or updated through the Joomla Update Manager 
<update> 
     <schemas> 
       <schemapath type="mysql">sql/updates/mysql</schemapath> 
     </schemas> 
</update> 

參見有關的manifest.xml結構here Joomla的1.6 Wiki頁面的詳細信息,這

+0

你能PLZ解釋更多細節。 – Kathir

+0

當您第一次安裝模塊時,它將被標記爲「安裝」,因此遵循標籤。如果您安裝並且組件已經安裝,那麼它被視爲升級,因此需要不同的sql文件。在這種情況下,我需要上面使用的更新標籤 –