function number_field_schema
number_field_schema($field)
Implements hook_field_schema().
File
- modules/field/modules/number/number.install, line 11
- Install, update and uninstall functions for the number module.
Code
function number_field_schema($field) {
switch ($field['type']) {
case 'number_integer':
$columns = array(
'value' => array(
'type' => 'int',
'not null' => FALSE
),
);
break;
case 'number_float':
$columns = array(
'value' => array(
'type' => 'float',
'not null' => FALSE
),
);
break;
case 'number_decimal':
$columns = array(
'value' => array(
'type' => 'numeric',
'precision' => $field['settings']['precision'],
'scale' => $field['settings']['scale'],
'not null' => FALSE
),
);
break;
}
return array(
'columns' => $columns,
);
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!field!modules!number!number.install/function/number_field_schema/7.x