Same name and namespace in other branches
  1. 7.x-2.x color_field.install \color_field_field_schema()

Implements hook_field_schema().

Defines the database schema of the field, using the format used by the Schema API.

The data we will store here is just one 7-character element.

File

./color_field.install, line 15

Code

function color_field_field_schema($field) {
    $columns = array(
        'rgb' => array(
            'type' => 'varchar',
            'length' => 7,
            'not null' => FALSE,
        ),
    );
    $indexes = array(
        'rgb' => array(
            'rgb',
        ),
    );
    return array(
        'columns' => $columns,
        'indexes' => $indexes,
    );
}