How do I create a TEXT column? I am trying to create a TEXT column.

function _mymodule_installed_fields() {
  return array(
    'mymodule_summary' =&gt; array(
      'field_name' =&gt; 'mymodule_summary',
      'label' =&gt; $t('Summary'),
      'type' =&gt; 'varchar',
      'not_null' =&gt; TRUE,
      'length' =&gt; '400',
    );
  );
}


I get a VARCHAR column. How do I get a TEXT column?
Given the code you are showing, which is similar to the code shown in Fields API, create new content type I take you are adding a new field to a content type, not simply creating a new table field for a database table. This explains why the code is using properties like field_name or label that implementations of hook_schema() would not use.

The values you can use for the type property are the ones described from the hook_field_info() implementations. In particular, if you look at the code of text_field_info(), you will see the following descriptions.


text: The field stores varchar text in the database
text_long: The field stores long text in the database


The confirm of what database field type is used for each entity field type comes from the implementations of hook_field_schema(), in particular from text_field_schema().

case 'text':
  $columns = array(
    'value' =&gt; array(
      'type' =&gt; 'varchar',
      'length' =&gt; $field['settings']['max_length'],
      'not null' =&gt; FALSE,
    ),
  );
  break;
case 'text_long':
  $columns = array(
    'value' =&gt; array(
      'type' =&gt; 'text',
      'size' =&gt; 'big',
      'not null' =&gt; FALSE,
    ),
  );
  break;


So, if you effectively need to use a TEXT database column  type, you need to use the following definition for the field.

array(
  'mymodule_summary' =&gt; array(
    'field_name' =&gt; 'mymodule_summary',
    'label' =&gt; $t('Summary'),
    'type' =&gt; 'text_long',
  );
);