Drupal 6模块安装文件没有在数据库中创建表

Geo*_*rge 4 drupal drupal-modules

我正在使用Schema API在Drupa 6.17上为我的模块创建表,但是这些表并没有在数据库中创建.我安装了Schema模块,它告诉我,虽然我的模块的模式被识别,但它的表不在数据库中.它出现在失踪之下:

Tables in the schema that are not present in the database.
test
* test_table
Run Code Online (Sandbox Code Playgroud)

以下是我的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');
}
Run Code Online (Sandbox Code Playgroud)

sal*_*xch 10

如果要在创建模块后添加模块安装,则需要从drupal db中的系统表中删除该记录,然后再次启用它.

禁用您的模块并保存

转到'system'表并在那里找到你的模块

删除该记录

启用您的模块并保存