Updating a module field schema I'm currently working on a project created by someone else. I have a textfield called "city". Currently the maximum limit is 255 characters. I want to update the maximum character to be 100. Looking at the code, it looks like the field was created using the features module. When I try to update the field, I got the FieldUpdateForbiddenException. I understand this is because I have value in the database. Is there a way update the field even if there is value in there? If I can't modify the database, can I change textfield max length in the form to be 100? 

Thanks!

The website doesn't have CCK, so I'm not sure how to modify these fields. I'm using Drupal 7.

What I did:
1. I upgraded registration_page.info to upgrade the version from 7.x-1.0 to 7.x-1.1
2. I changed the field max length to 100 in registration.features.field.info

When I tried to deploy, I got this error

  [sshexec] WD php: FieldUpdateForbiddenException: field_sql_storage cannot          [error]
  [sshexec] change the schema for an existing field with data. in
  [sshexec] field_sql_storage_field_update_forbid() (line 229 of
  [sshexec] /var/lib/www.mine.com/deploys/site_20140515_140323/modules/field/modules/field_sql_storage/field_sql_storage.module).
  [sshexec] Cannot modify header information - headers already sent by (output     [warning]
  [sshexec] started at
  [sshexec] /var/lib/www.mine.com/deploys/site_20140515_140323/sites/default/drushrc.php:2)
  [sshexec] bootstrap.inc:1212
  [sshexec] FieldUpdateForbiddenException: field_sql_storage cannot change the schema for an existing field with data. in field_sql_storage_field_update_forbid()


This is what the code look like in registration.features.field.info

 // Exported field: 'node-registration-page-field_city'.
  $fields['node-registration_page-field_city'] = array(
    'field_config' =&gt; array(
      'active' =&gt; '1',
      'cardinality' =&gt; '1',
      'deleted' =&gt; '0',
      'entity_types' =&gt; array(),
      'field_name' =&gt; 'field_city',
      'foreign keys' =&gt; array(
        'format' =&gt; array(
          'columns' =&gt; array(
            'format' =&gt; 'format',
          ),
          'table' =&gt; 'filter_format',
        ),
      ),
      'indexes' =&gt; array(
        'format' =&gt; array(
          0 =&gt; 'format',
        ),
      ),
      'locked' =&gt; '0',
      'module' =&gt; 'text',
      'settings' =&gt; array(
        'max_length' =&gt; '255',
      ),
      'translatable' =&gt; '0',
      'type' =&gt; 'text',
    ),
    'field_instance' =&gt; array(
      'bundle' =&gt; 'registration_page',
      'default_value' =&gt; NULL,
      'deleted' =&gt; '0',
      'description' =&gt; 'Please enter your city',
      'display' =&gt; array(
        'default' =&gt; array(
          'label' =&gt; 'above',
          'module' =&gt; 'text',
          'settings' =&gt; array(),
          'type' =&gt; 'text_default',
          'weight' =&gt; 31,
        ),
        'teaser' =&gt; array(
          'label' =&gt; 'above',
          'settings' =&gt; array(),
          'type' =&gt; 'hidden',
          'weight' =&gt; 0,
        ),
      ),
      'entity_type' =&gt; 'node',
      'field_name' =&gt; 'field_city',
      'label' =&gt; 'City',
      'required' =&gt; 0,
      'settings' =&gt; array(
        'text_processing' =&gt; '0',
        'user_register_form' =&gt; FALSE,
      ),
      'widget' =&gt; array(
        'active' =&gt; 1,
        'module' =&gt; 'text',
        'settings' =&gt; array(
          'size' =&gt; '60',
        ),
        'type' =&gt; 'text_textfield',
        'weight' =&gt; '26',
      ),
    ),
  );
As you mentioned, you already have textfield with 255 character length and also contains data. If you want reduce length of this field then you need to make sure that there is no data within this field having more than 100 character length. Because if this field contains any data more than 100 character length then you can't alter it in this way. My suggestion to you is first take backup of this table and empty this table. Then you would be able to change its length and then you can import this table data. If there is any data more than 100 character either it will stored in truncated way or give you any warnings for this. One thing you need to remember you need to do this offline, this question is specific to database and take care of every piece of data. There is possibility you might need to make some changes manually, so should take data base backup first.