summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.26/modules/field/modules/number/number.install
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.26/modules/field/modules/number/number.install')
-rw-r--r--kolab.org/www/drupal-7.26/modules/field/modules/number/number.install45
1 files changed, 45 insertions, 0 deletions
diff --git a/kolab.org/www/drupal-7.26/modules/field/modules/number/number.install b/kolab.org/www/drupal-7.26/modules/field/modules/number/number.install
new file mode 100644
index 0000000..02c7a30
--- /dev/null
+++ b/kolab.org/www/drupal-7.26/modules/field/modules/number/number.install
@@ -0,0 +1,45 @@
+<?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,
+ );
+}