Add fields to entity in module update I'm using Drupal 7 and I have a module which has working implementation of the Entity API module. 

In my_module.install file there is a hook_schema() in which I defined table columns: 

$schema['my_subscription'] = array(
'description' =&gt; t('The base table for subscriptions'),
    'fields' =&gt; array(
      'sid' =&gt; array(
        'description' =&gt; t('Primary key identifier for an subscription log.'),
        'type' =&gt; 'serial',
        'unsigned' =&gt; TRUE,
        'not null' =&gt; TRUE,
      ),
      'email' =&gt; array(
        'description' =&gt; t('Email of a users subscription.'),
        'type' =&gt; 'varchar',
        'length' =&gt; '250',
        'not null' =&gt; TRUE,
      ),
      'name' =&gt; array(
        'description' =&gt; t('Full name of a user subscribing.'),
        'type' =&gt; 'varchar',
        'length' =&gt; '250',
        'not null' =&gt; FALSE,
      ),
    ),
    'primary key' =&gt; array('sid'),
);

return $schema;


In my_module.module there is a hook_entity_info():

 /**
 * Implements hook_entity_info().
 */
function my_module_entity_info() {
  return array(
    'my_subscription' =&gt; array(
      'label' =&gt; t('Subscriptions'),
      'base table' =&gt; 'my_subscription',
      'entity class' =&gt; 'Entity',
      'controller class' =&gt; 'EntityAPIController',
      'fieldable' =&gt; FALSE,
      'entity keys' =&gt; array(
        'id' =&gt; 'sid',
      ),
      'bundles' =&gt; array(),
      'module' =&gt; 'my_subscription',
    ),
  );
}


Records are created from the module like this:

    $values = array(
      'email' =&gt; $email,
      'name' =&gt; $name,
    );

    $subscription = entity_create('my_subscription', $values);


It's all working good, and there are couple of hundred subscriptions at the moment.

Now I need to expand the table with one more column, I'll call it 'test' for simplicity. I added a hook_update_N() to the my_module.install, added 

 db_add_field('my_subscription', 'test', array(
    'type' =&gt; 'varchar',
    'length' =&gt; 64,
    'not null' =&gt; FALSE,
  ));


and ran update.php which added the column as expected.

Now, when I try to pass new column value in the $values array like this

    $values = array(
      'email' =&gt; $email,
      'name' =&gt; $name,
      'test' =&gt; 'lorem ipsum'
    );

    $subscription = entity_create('my_subscription', $values);


record is made, but the newly added 'test' column has the value of NULL no matter what. 

I suppose I need to tell Entity API that there is new field that needs to be populated as well, but I don't know how.
Using the API to add a column is the right thing to do, but it can't/won't update the code in your hook_schema() definition for you.

Drupal relies on that definition to map values to columns, so if you haven't explicitly declared the 'test' column, entity API doesn't know it exists, and so discards the value.

To solve, you should declare the new column in hook_schema():

$schema['my_subscription'] = array(
  'description' =&gt; t('The base table for subscriptions'),
  'fields' =&gt; array(
    'sid' =&gt; array(
      'description' =&gt; t('Primary key identifier for an subscription log.'),
      'type' =&gt; 'serial',
      'unsigned' =&gt; TRUE,
      'not null' =&gt; TRUE,
    ),
    'email' =&gt; array(
      'description' =&gt; t('Email of a users subscription.'),
      'type' =&gt; 'varchar',
      'length' =&gt; '250',
      'not null' =&gt; TRUE,
    ),
    'name' =&gt; array(
      'description' =&gt; t('Full name of a user subscribing.'),
      'type' =&gt; 'varchar',
      'length' =&gt; '250',
      'not null' =&gt; FALSE,
    ),
    'test' =&gt; array(
      'description' =&gt; t('Test field.'),
      'type' =&gt; 'varchar',
      'length' =&gt; 255,
    ),
  ),
  'primary key' =&gt; array('sid'),
);


After you clear caches things should start working.