Alter schema on creating a new field I want to create a module that on installing and creating a new field on a content type it should alter the schema of another module.

Im trying to use hook_storage_create_field to react on creating an new field but its not running.


function mymodule_field_storage_create_field($field) {
  exit(var_dump($schema));
  $schema = _field_sql_storage_schema($field);
}


Im I misusing the hook? or there is something faulty in my module?

Update

What Im trying to do is to create a new module that extends the Link module to work like Facebook parser.

So when users add a new link a preview will show a preview like this Redsun parser
The functionality is already made and adapted into Drupal, but still having problem extending link schema to have extra fields for images and body fields.

A new widget is added to link field called "link with parser", and it will fire our extra codes to save and validate the link.
hook_field_storage_create_field and hook_field_create are called when the user creates a new field, i.e. from "Manage Fields", "Add new field".  In my tests, hook_field_create was called as expected, but hook_field_storage_create_field was not called.  I did not look into why this was, because (a) you could use hook_field_create here just as well as hook_field_storage_create, and (b) this isn't really the approach you should be taking to implement the functionality you need.  If you were going to modify the schema for the link field, you would do it once when your module was installed, in hook_install.  Your use case is much more complicated than the standard behavior of the link field, though; you would be better off creating your own field type, and do all of your field storage management in one place.  You might want to look at the source for existing fields that have complex data storage needs, such as the date field.