I'm creating a module to introduce a new field type. I downloaded the example module by drupal and i start programming. But when I install the module the .install don't add colums to the dbtable related to new field.
function field_instagram_field_schema($field) {
watchdog('start field_instagram_field_schema()', 'We are in!');
switch ($field['type']) {
case 'instagram_gallery':
$columns = array(
'stream_type' => array(
'type' => 'varchar',
'length' => '25',
'not null' => FALSE
),
'input_tag' => array(
'type' => 'varchar',
'length' => '25',
'not null' => FALSE
),
'thumb_dimetion' => array(
'type' => 'varchar',
'length' => '25',
'not null' => FALSE
),
'thumb_number' => array(
'type' => 'varchar',
'length' => '25',
'not null' => FALSE
)
);
break;
}
return array('columns' => $columns);
}
UPDATED
When i install the module and create a field of this new type this function is not runned..
field_instagram
? Where is this code, the .install file or .module file? Have you tried putting some debug code in the function (awatchdog()
call for example) to see if the function is definitely being executed when the module is installed?