Updating Entity Properties with hook_update_N() I have a custom module which defines a custom entity. Now I would like to add a new field to this entity without reinstalling my module. I tried it with the hook_update_N() function:

/**
 * Description
 */
function MY_MODULE_update_7100() {
  $spec = array(
    'type' =&gt; 'int',
    'description' =&gt; 'Description',
    'not null' =&gt; FALSE,
  );
  db_add_field('my_table', 'my_new_field', $spec);
}


in my Module, I updated my existing hook_entity_property_info_alter to add the definition for this field:

function MY_MODULE_entity_property_info_alter(&amp;$info) {
  $props = &amp;$info['my_entity']['properties'];
  // snip
  $props['my_new_field'] = array(
    'label' =&gt; t('My Label'),
    'type' =&gt; 'integer',
    'description' =&gt; t('My Description'),
    'schema field' =&gt; 'my_new_field',
  );
  // snap
}


After updating, I can still create and update the entity, but sadly not my new Field which I created.

What did I wrong?

I looked for an example in the commerce module. But the module is using drupal_write_record instead of entity_save.

PS: I already saw this issue but it didn't worked.
I've had this problem myself in the past and almost pulled all my hair out! :)

It turned out that I had forgotten to update my hook_schema declaration within the .install file of my module, and include the definition of the new database field for my entity table.

Adding in the definition should make the new field available to you.