2014-01-23 181 views
0

數據庫自定義模塊如果在Magento我的模塊名稱是quote看看請生成數據庫的代碼:關於在Magento

<?php 

$installer = $this; 

$installer->startSetup(); 

$installer->run(" 

-- DROP TABLE IF EXISTS {$this->getTable('quote')}; 
CREATE TABLE {$this->getTable('quote')} (
    `quote_id` int(11) unsigned NOT NULL auto_increment, 
    `product_id` int(11) unsigned NOT NULL, 
    `name` varchar(255) NOT NULL default '', 
    `surname` varchar(255) NOT NULL default '', 
    `mail` varchar(255) NOT NULL default '', 
    `message` text NOT NULL default '', 
    `status` smallint(6) NOT NULL default '0', 
    `created_time` datetime NULL, 
    `update_time` datetime NULL, 
    PRIMARY KEY (`quote_id`) 
) ENGINE=InnoDB DEFAULT CHARSET=utf8; 

    "); 

$installer->endSetup(); 

哪個表的名字出現在我的Magento數據庫。而我怎麼知道安裝數據庫的錯誤,一些日誌等。 謝謝!

回答

1

你在config.xml中調用了什麼?沿着這些路線的東西:

<models> 
     <quote_mysql4>     
      <entities> 
       <quote> 
        <table>table_name</table> 
       </quote> 
      </entities> 
     </quote_mysql4>  
    </models>