function field_test_field_schema

Implements hook_field_schema().

File

drupal/core/modules/field/tests/modules/field_test/field_test.install, line 116
Install, update and uninstall functions for the field_test module.

Code

function field_test_field_schema($field) {
  if ($field['type'] == 'test_field') {
    return array(
      'columns' => array(
        'value' => array(
          'type' => 'int',
          'size' => 'medium',
          'not null' => FALSE,
        ),
      ),
      'indexes' => array(
        'value' => array(
          'value',
        ),
      ),
    );
  }
  else {
    return array(
      'columns' => array(
        'shape' => array(
          'type' => 'varchar',
          'length' => 32,
          'not null' => FALSE,
        ),
        'color' => array(
          'type' => 'varchar',
          'length' => 32,
          'not null' => FALSE,
        ),
      ),
    );
  }
}