Can't add column to renamed table When I first developed this module internally (not on Druple.com) the module_schema function created a table with the same name of the module (it was the only table, so it made sense. Short sighted.). 

But I now need a 2nd table, so the first table should have a more sensible name. There is also a requirement for an additional field in the original table.

 function afd_pce_update_dependencies(){
   // update_7201 needs to run after update_7200.
   $dependencies['mymodule_field_mappings'][7201] = array(
     'mymodule_field_mappings' =&gt; 7200,
   );

   return $dependencies;
 }

 function mymodule_update_7200(){
      db_rename_table('mymodule', 'mymodule_field_mappings');
    }

 function mymodule_update_7201(){
   $spec = array(
     'type' =&gt; 'varchar',
     'description' =&gt; "The fieldset that this mapping belongs to",
     'length' =&gt; 15,
     'not null' =&gt; FALSE,
   );
   db_add_field('fieldset_type','mymodule_field_mappings',$spec);
 }


When I run update.php I get the error

Update #7201
Failed: DatabaseSchemaObjectDoesNotExistException:
Cannot add field &lt;em class="placeholder"&gt;fieldset_type&lt;/em&gt;.
&lt;em class="placeholder"&gt;mymodule_field_mappings&lt;/em&gt;: table doesn't exist. 
in DatabaseSchema_mysql-&gt;addField() (line 325 of
{filepath}\includes\database\mysql\schema.inc).
I think your mixing up table names and module names in hook_update_dependencies().

First of all, you don't need hook_update_dependencies() to declare dependencies inside your own module. The updates will always be run sequentially, so that mymodule_update_7200() will always run before mymodule_update_7201().

Then, if you want to use hook_update_dependencies(), you would use it to declare inter-module depenencies like this:

function mymodule_update_dependencies(){
  $dependencies['mymodule'][7201] = array(
    'other_module' =&gt; 7203,
  );
  return $dependencies;
}


Now to your error. Can you check in the system table record for your module what the current schema version is? From the code and the error message I would suppose, that the database is already at schema 7200 (at least officially) but that somehow the renaming has not been done. Is it maybe possible that you have altered the database manually?

Edit: You are mixing up the arguments to db_add_field. It must be db_add_field('mymodule_field_mappings', 'fieldset_type', $spec);