field_test_field_schema

7 field_test.install field_test_field_schema($field)
8 field_test.install field_test_field_schema($field)

Implements hook_field_schema().

File

modules/field/tests/field_test.install, line 119
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,
        ),
      ),
    );
  }
}
Login or register to post comments