You are here

function double_field_field_schema in Double Field 7

Same name and namespace in other branches
  1. 7.2 double_field.install \double_field_field_schema()

Implements hook_field_schema().

File

./double_field.install, line 12
Install, update and uninstall functions for the double field module.

Code

function double_field_field_schema($field) {
  $columns = array(
    'first' => array(
      'type' => 'varchar',
      'length' => $field['settings']['first_maxlength'],
      'not null' => FALSE,
    ),
    'second' => array(
      'type' => 'varchar',
      'length' => $field['settings']['second_maxlength'],
      'not null' => FALSE,
    ),
  );
  $indexes = array(
    'first' => array(
      'first',
    ),
    'second' => array(
      'second',
    ),
  );
  return array(
    'columns' => $columns,
    'indexes' => $indexes,
  );
}