1 text.install text_field_schema($field)

Implements hook_field_schema().

File

core/modules/field/modules/text/text.install, line 10
Install, update and uninstall functions for the text module.

Code

function text_field_schema($field) {
  switch ($field['type']) {
    case 'text':
      $columns = array(
        'value' => array(
          'type' => 'varchar',
          'length' => $field['settings']['max_length'],
          'not null' => FALSE,
        ),
      );
      break;

    case 'text_long':
      $columns = array(
        'value' => array(
          'type' => 'text',
          'size' => 'big',
          'not null' => FALSE,
        ),
      );
      break;

    case 'text_with_summary':
      $columns = array(
        'value' => array(
          'type' => 'text',
          'size' => 'big',
          'not null' => FALSE,
        ),
        'summary' => array(
          'type' => 'text',
          'size' => 'big',
          'not null' => FALSE,
        ),
      );
      break;
  }
  $columns += array(
    'format' => array(
      'type' => 'varchar',
      'length' => 255,
      'not null' => FALSE,
    ),
  );
  return array(
    'columns' => $columns,
    'indexes' => array(
      'format' => array('format'),
    ),
  );
}