2012-07-04 126 views
0

Magento的不運行的我module.But安裝腳本版本的安裝腳本core_resource table.Here是越來越添加是我的文件config.xml中的Magento的不運行SQL安裝腳本

部分

<config> 
     <modules> 
      <Company_Brands> 
       <version>1.0.0</version> 
      </Company_Brands> 
     </modules> 
     <global> 
      <models> 
       <brands> 
        <class>Company_Brands_Model</class> 
        <resourceModel>brands_mysql4</resourceModel> 
       </brands> 
       <brands_mysql4> 
        <class>Company_Brands_Model_Mysql4</class>    
       </brands_mysql4> 
      </models> 

     <resources> 
      <brands_setup> 
       <setup> 
        <module>Company_Brands</module> 
        <class>Company_Brands_Model_Mysql4_Setup</class> 
       </setup> 
       <connection> 
        <use>core_setup</use> 
       </connection> 
      </brands_setup> 
      <brands_read> 
       <connection> 
        <use>core_read</use> 
       </connection> 
      </brands_read> 
      <brands_write> 
       <connection> 
        <use>core_write</use> 
       </connection> 
      </brands_write> 
     </resources> 
</global> 
</config> 

應用程序/代碼/本地/公司/品牌/ SQL/brands_setup/mysql4安裝-1.0.0.php

$installer = $this; 
$installer->startSetup(); 

$data = array(
    'label' => 'Brands', 
    'type' => 'select' 
    'input' => 'text', 
    'global'=> Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL, 
    'required'=>false, 
    'is_configurable'=>true, 
    'compareble'=>true, 
    'filterable' =>true, 
    'searchable'=>true 
); 

$installer->addAttribute('catalog_product','some_brands',$data); 

$installer->endSetup(); 

應用程序/代碼/本地/公司/品牌/型號/ mysql4/Setup.php

class Company_Brands_Model_Mysql4_Setup extends Mage_Eav_Model_Entity_Setup 
{ 

} 
+3

你有開發者模式開啓?您是否收到任何其他錯誤? – Sturm

+1

http://stackoverflow.com/questions/4717535/my-magento-extension-install-script-will-not-run和其他許多其他的 –

+0

爲什麼你需要空白的安裝模型? –

回答

0

感謝大家的建議。

,在後'select'

$data = array(
    'label' => 'Brands', 
    'type' => 'select' 
    'input' => 'text', 

失蹤應該

$data = array(
     'label' => 'Brands', 
     'type' => 'select', 
     'input' => 'text',