drupal_write_record in drupal 6 returning false


drupal_write_record in drupal 6 returning false

当我运行drupal_write_record时,它总是返回false。 我已经调试了该函数,并看到drupal_get_schema函数内部drupal_write_record函数返回 false。 此外,如果我调试到drupal_get_schema函数并查看

 $schema = $cached->data; 

我的新表不包含在$schema数组中。 我尝试刷新缓存、重新安装模块并运行更新.php但没有任何帮助。 如果它有帮助,我还包含了我编写的 .install 文件,该文件将新表添加到数据库中:

<?php
// $Id: my_module.install,v 1.00.0.1 2012/10/21 00:23:32  Exp $
/**
 * Implementation of hook_schema().
 */
function my_module_schema() {
      $schema = array();
      $schema['my_module_pending_inserts'] = array(
        'fields' => array(
          'id' => array(
             'description' => 'primary key',
             'type' => 'serial',
             'size' => 'tiny',
             'not null' => TRUE,
          ),
          'json_array_data' => array(
            'type' => 'text',
            'not null' => TRUE,
          ),
          'successfully_run' => array(                
            'type' => 'int',
            'not null' => TRUE,
            'default' => 0,
          ),
          'date_created' => array(               
            'type' => 'int',
            'not null' => TRUE,
            'default' => 0,
          ),
          'date_updated' => array(               
            'type' => 'int',
            'not null' => TRUE,
            'default' => 0,
          )
        ),
        'primary key' => array('id'),
      );
    return $schema;
}
function jira_reporting_install() {
  // Create tables.
  drupal_install_schema('my_module_pending_inserts');
}
function my_module_uninstall() {
  // Remove tables.
  drupal_uninstall_schema('my_module_pending_inserts');
  // Delete variables
  variable_del('my_module_variable1');
  variable_del('my_module_variable2');
  variable_del('my_module_variable3');   
}
function my_module_update_2() {
    $up = array();
    $tbl = array(
            'fields' => array(
                'id' => array(
                    'type' => 'serial', 'not null' => TRUE
                ),
                'json_array_data' => array(
                    'type' => 'varchar',
                    'length' => 250,
                    'not null' => True
                ),
                'successfully_run' => array(
                       'type' => 'int'
                ),
                'date_created' => array(
                        'type' => 'int'
                ),
                'date_updated' => array(
                        'type' => 'int'
                ),
            ),
            'primary key' => array('id'),
        );

    db_create_table(&$up, 'my_module_pending_inserts', $tbl);
    return $up;
}

没关系,这是我_schema名字中的一个错字