Project

General

Profile

Paste
Download (873 Bytes) Statistics
| Branch: | Revision:

root / drupal7 / modules / field / modules / number / number.install @ bd0d4c5c

1
<?php
2

    
3
/**
4
 * @file
5
 * Install, update and uninstall functions for the number module.
6
 */
7

    
8
/**
9
 * Implements hook_field_schema().
10
 */
11
function number_field_schema($field) {
12
  switch ($field['type']) {
13
    case 'number_integer' :
14
      $columns = array(
15
        'value' => array(
16
          'type' => 'int',
17
          'not null' => FALSE
18
        ),
19
      );
20
      break;
21

    
22
    case 'number_float' :
23
      $columns = array(
24
        'value' => array(
25
          'type' => 'float',
26
          'not null' => FALSE
27
        ),
28
      );
29
      break;
30

    
31
    case 'number_decimal' :
32
      $columns = array(
33
        'value' => array(
34
          'type' => 'numeric',
35
          'precision' => $field['settings']['precision'],
36
          'scale' => $field['settings']['scale'],
37
          'not null' => FALSE
38
        ),
39
      );
40
      break;
41
  }
42
  return array(
43
    'columns' => $columns,
44
  );
45
}