In which file should I write db_add_field function
I think you should write your code for adding new field in DB in your .module file.
Here is the code for you :

function xyz_schema_alter(&amp;$schema) {
  // Add field to existing schema.
  $schema['node']['fields']['show_in_inbox'] = array(
    'type' =&gt; 'int',
    'length' =&gt; '4',
    'default' =&gt; '1',
    'not null' =&gt; TRUE,
    'unsigned' =&gt; TRUE,  
    'description' =&gt; 'Field added by xyz module',
  ); 
}

function xyz_enable(){
    if (!db_field_exists('node', 'show_in_inbox')) {
        $schema = drupal_get_schema('node');
        db_add_field('node', 'show_in_inbox', $schema['fields']['show_in_inbox']);
    }
}


The new field will be added in your existing database on enabling this module.