I have re-installed modules before, but I can't get it this time. These are the steps I take:

  1. Uninstall the modules (by deselecting them on the module list and clicking submit changes)
  2. Remove the Module Files from the module folder
  3. Check the database for any potential left over tables (specifically sms_feed)
  4. Check the system table for any left over rows dealing with my modules
  5. Delete anything related to my modules in the database
  6. Clear the cache
  7. Reinstall the modules

I always get the following error:

DatabaseSchemaObjectExistsException: Table sms_feed already exists. in DatabaseSchema->createTable() (line 657 of C:\xampp\htdocs\amaware\includes\database\schema.inc).

Do you have any idea?

  • The devel module provides a page (devel/reinstall) to comfortably reinstall modules. It might be worth giving that a try as it always works for me when I get errors like you're getting
    – Clive
    Aug 23 '12 at 14:42

What you have done in the first step is disabling the module, not uninstalling it. To uninstall it, you need to click on the "Uninstall" tab, select that module, and then click on the "Uninstall" button.

The exception raised from DatabaseSchema::createTable() is because it contains the following code.

  if ($this->tableExists($name)) {
    throw new DatabaseSchemaObjectExistsException(t('Table %name already exists.', array('%name' => $name)));

The code in DatabaseSchema::tableExists() is then the following one.

  $condition = $this->buildTableNameCondition($table);
  $condition->compile($this->connection, $this);
  return (bool) $this->connection->query("SELECT 1 FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();

You could also manually remove the database table, but if the information about that table is still contained in information_schema.tables, DatabaseSchema::createTable() will raise an exception.


The step you are missing I believe (and what is likely causing the "table still exists error") is after your step 1 (and before step 2) you should visit admin/modules/uninstall (on D7) admin/build/modules/uninstall (on D6). Check the module you previously disabled and click uninstall. This should remove all associated tables and will allow you to avoid your steps 3, 4 & 5.

  • Thank you! I do things once and I get upset when I don't get it perfect the second time... thanks! Aug 23 '12 at 15:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.