相关疑难解决方法(0)

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

我正在使用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 …
Run Code Online (Sandbox Code Playgroud)

drupal drupal-modules

4
推荐指数
1
解决办法
5985
查看次数

标签 统计

drupal ×1

drupal-modules ×1