我正在使用Schema API在Drupa 6.17上爲我的模塊創建表,但表不會在數據庫中創建。我安裝了Schema模塊,它告訴我雖然我的模塊模式被識別,但它的表不在數據庫中。它出現在Missing下:Drupal 6模塊安裝文件不在數據庫中創建表
Tables in the schema that are not present in the database.
test
* test_table
這裏是我的test.install文件的內容。
<?php
// $Id$
function test_schema() {
$schema['test_table'] = array(
'description' => t('Test table'),
'fields' => array(
'nid' => array(
'description' => t('test field'),
'type' => 'serial',
'not null' => TRUE,
),
'options' => array(
'description' => t('other test field'),
'type' => 'text',
'not null' => FALSE,
),
),
'primary key' => array('nid'),
);
return $schema;
}
function test_install() {
drupal_install_schema('test');
}
function test_uninstall() {
drupal_uninstall_schema('test');
}
我剛試過,仍然得到相同的結果。 – George 2010-08-16 19:38:23
你是否禁用了模塊,卸載(會出錯),然後重新啓用它? – Kevin 2010-08-16 19:43:34
沒有等待,你說得對,我混了起來。安裝/卸載看起來不錯。 Schema模塊的用途是什麼? – Kevin 2010-08-16 19:48:00