diff --git a/iban_field.install b/iban_field.install
index d2b11d1..f4c60c9 100644
--- a/iban_field.install
+++ b/iban_field.install
@@ -68,3 +68,25 @@ function iban_field_install() {
   );
   drupal_set_message(filter_xss_admin($message), 'warning');
 }
+
+/**
+ * Implements hook_update_N().
+ * 
+ * Update the max length allowed for iban field.
+ */
+function iban_field_update_7001() {
+  // Get all fields created of type iban_field, and modify his tables
+  // (field_data and field_revision), adding the max length new.
+  $fields = field_info_fields();
+  $spec = array(
+    'type' => 'varchar',
+    'length' => IBAN_FIELD_MAX_LENGTH,
+    'not null' => FALSE,
+  );
+  foreach ($fields as $field_name => $field) {
+    if ($field['type'] == 'iban_field') {
+      db_change_field('field_data_' . $field_name, $field_name . '_iban_field', $field_name . '_iban_field', $spec);
+      db_change_field('field_revision_' . $field_name, $field_name . '_iban_field', $field_name . '_iban_field', $spec);
+    }
+  }
+}
diff --git a/iban_field.module b/iban_field.module
index 0c31d4d..fe4785b 100644
--- a/iban_field.module
+++ b/iban_field.module
@@ -8,6 +8,9 @@
  * will be validated as an IBAN number.
  */
 
+// Define the max length for iban field.
+define('IBAN_FIELD_MAX_LENGTH', 31);
+
 /**
  * Implements hook_menu().
  */
@@ -41,7 +44,7 @@ function iban_field_field_info() {
     'iban_field' => array(
       'label' => t('IBAN'),
       'description' => 'Field containing IBAN number',
-      'settings' => array('max_length' => 22),
+      'settings' => array('max_length' => IBAN_FIELD_MAX_LENGTH),
       'instance_settings' => array(
         'text_processing' => 0,
       ),
@@ -61,7 +64,7 @@ function iban_field_field_schema($field) {
     'columns' => array(
       'iban_field' => array(
         'type' => 'varchar',
-        'length' => 22,
+        'length' => IBAN_FIELD_MAX_LENGTH,
         'not null' => FALSE,
       ),
     ),
