46 lines
874 B
Plaintext
46 lines
874 B
Plaintext
<?php
|
|
|
|
/**
|
|
* @file
|
|
* Install, update, and uninstall functions for the Number module.
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_field_schema().
|
|
*/
|
|
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,
|
|
);
|
|
}
|