You are here

function radioactivity_field_schema in Radioactivity 7.2

Same name and namespace in other branches
  1. 7 radioactivity.install \radioactivity_field_schema()

Implement hook_field_schema().

File

./radioactivity.install, line 6

Code

function radioactivity_field_schema($field) {
  $columns = array();
  $indexes = array();
  if ($field['type'] == RADIOACTIVITY_FIELD_TYPE) {
    $columns = array(
      RADIOACTIVITY_FIELD_ENERGY => array(
        'type' => 'float',
        'not null' => FALSE,
      ),
      RADIOACTIVITY_FIELD_TIMESTAMP => array(
        'type' => 'int',
        'not null' => FALSE,
      ),
    );
    $indexes = array(
      'energy' => array(
        RADIOACTIVITY_FIELD_ENERGY,
      ),
    );
  }
  return array(
    'columns' => $columns,
    'indexes' => $indexes,
  );
}