2015-04-17 25 views
1

我已經在custom_notifications.install文件中編寫了下面的代碼。Drupal 7 - module.install文件架構錯誤

當我試圖啓用該模塊時,它給了我錯誤「網站遇到意外錯誤,請稍後再試。」

請幫助我。

function custom_notifications_schema() { 

$schema['custom_notification_log'] = array(
'fields' => array(
    'cnl' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), 
    'notification_type' => array('type' => 'varchar', 'length' => 64), 
    'notification_type_id' => array('type' => 'int', 'unsigned' => TRUE), 
    'uid' => array('type' => 'int', 'unsigned' => TRUE), 
    'viewed_on' => array('type' => 'int', 'unsigned' => TRUE), 
) 
); 
return $schema; 
} 
+1

上面的代碼似乎很好..問題是其他地方... –

+0

當我刪除此功能,然後我沒有得到任何錯誤。我認爲有一些錯誤是隻有功能。 –

回答

0

幾件事情要嘗試:

1)看看你DBLOG(Reports -> Recent log messages)提供更多信息PHP錯誤。

2)轉到Uninstall選項卡,查看您的模塊是否已列出。如果是,則卸載它,然後嘗試重新安裝。

0

SERIAL是BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE的別名。嘗試刪除您的cnl字段的無符號和非空密鑰