You are here

function redhen_fields_field_schema in RedHen CRM 7

Implements hook_field_schema().

File

modules/redhen_fields/redhen_fields.install, line 11
Install, update and uninstall functions for the text module.

Code

function redhen_fields_field_schema($field) {
  $columns = array();
  $indexes = array();
  switch ($field['type']) {
    case 'redhen_email':
      $columns = array(
        'value' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => FALSE,
        ),
        'hold' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'default' => 0,
        ),
        'bulk' => array(
          'type' => 'int',
          'unsigned' => TRUE,
          'default' => 0,
        ),
      );
      $indexes = array(
        'redhen_email_address' => array(
          'value',
        ),
      );
      break;
  }
  $columns += array(
    'default' => array(
      'type' => 'int',
      'unsigned' => TRUE,
      'default' => 0,
    ),
    'label_id' => array(
      'type' => 'int',
      'unsigned' => TRUE,
      'default' => 0,
    ),
  );
  return array(
    'columns' => $columns,
    'indexes' => $indexes,
  );
}