You are here

function radioactivity_field_schema in Radioactivity 7

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

Implement hook_field_schema().

File

./radioactivity.install, line 7

Code

function radioactivity_field_schema($field) {
  $columns = array();

  // @FIXME: precision should be checked... float might just not do it for big sites
  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,
      ),
    );
  }
  return array(
    'columns' => $columns,
  );
}