How to alter 'not null' value of field after creation I have a custom module that defines a field wherein I erroneously set the 'not null' value to be FALSE when I should have set it to TRUE. Ideally I would like to remedy this by means of an update hook. How can I do that?

function MYMODULE_field_schema($field) {
  $columns = array(
    'payments' =&gt; array(
      'type' =&gt; 'varchar', 
      'length' =&gt; 20, 
      'not null' =&gt; FALSE,
      'description' =&gt; 'Number of payments made',
    ),
  );
  return array('columns' =&gt; $columns);
}


From reading the documentation it looks like I could do it by passing a field structure to field_update_field, but I don't know what to put in the field structure

function MYOTHERMODULE_update_70xx() {

 $field = array(
    // What should I put in here in order to change 'not null' to FALSE
    // and as a bonus, change the type from 'varchar' 
    // to an integer (number_integer?)
);

 field_update_field($field);
}


Am I over-simplifying things? I know it's often not possible to modify fields if they contain data, and in this particular case I can delete and re-create the content type without too much difficulty, but no point doing all of that if there's no need.
You need to ud db_change_field function to change structure of table field.

function MYOTHERMODULE_update_70xx() {
  db_change_field('tablename', 'payments', 'payments', array(
    'not null' =&gt; TRUE,
  ));
}