(Newbie question) Something goes wrong here with db_add_field
First, make sure that Statistics module installed/enabled.

Second, replace your code with the following code:

function node_statistics_schema_alter(&amp;$schema) {
  // Add field to existing schema.
  $schema['accesslog']['fields']['nid'] = array(
    'type' =&gt; 'int',
    'length' =&gt; '11',
    'default' =&gt; '0',
    'not null' =&gt; TRUE,
    'unsigned' =&gt; TRUE,  
    'description' =&gt; 'Field added by node_statistics',
  ); 
}

function node_statistics_install() { 
  $table = 'accesslog';

  $schema = drupal_get_schema($table);

  db_add_field($table, 'nid', $schema['fields']['nid']);
}


Note: make sure to uninstall and install your module after you apply the new code.