Hello I need to update the field type of one of my content types. The content type is of a module so I need to do this with the Drupal API for let users update the module for their 7.x-1.0 branch.
This is the hook for update the field, I need to change it from Integer to Decimal like this:
/**
* Change field_inq_description field from Integer to Decimal
*/
function field_updates_update_7100() {
// Manual database changes.
db_query("UPDATE {field_config} SET type = 'number_decimal' WHERE field_name = 'field_rin'");
db_change_field('field_data_field_rin', 'field_rin_value', 'field_rin_value', array(
'type' => 'numeric',
'precision' => '10',
'scale' => '2',
));
db_change_field('field_revision_field_rin', 'field_rin_value', 'field_rin_value', array(
'type' => 'numeric',
'precision' => '10',
'scale' => '2',
));
// Clear caches.
field_cache_clear(TRUE);
// Apply the new field instance configuration.
}
After I apply the update with update.php script I get these notices everywhere in the test website.
Notice: Undefined index: precision in number_field_schema() (line 35 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install).
Notice: Undefined index: scale in number_field_schema() (line 36 of /home/servilla/public_html/servillantasgiraldo.com.co/modules/field/modules/number/number.install).
What Im I doing wrong?