Module developers who create modules that modify the drupal database should provide a .mysql file that can be used to remove all the database records and tables associated with their module during uninstallation.
This is particularly important when bugs or incompatibilities arise.
EXAMPLE:
This occurred for me after installing the privatemsg module and then the relationship module.
The second installation broke BOTH modules.
Even after 'uninstalling' both of them, their database modifications still exist.
The corrupted database continues to produce error messages!
Re-installing privatemsg alone, without relationship, fails because the drupal database is now corrupted somehow.
complete uninstall .mysql files would help and would help document what needs to be removed from the drupal database.
Comments
you're right!
you're right! My experiences are the same than yours.
I'v found eg. taxonomy_acces <--> evaulation confict and thats why I can't remove evaulation module without drupal a defect.
http://drupal.org/node/48240
Amen to that.
Amen to that.
---
"Please drupal responsibly: give as much help as you get."
I agree
Yepp!
Agree too
Take a look at the system table: it holds the state of the different modules.
If the module is still in the system table, Drupal will think that the module is still installed.
I agree that a module uninstaller would be a useful tool.
--
Professional Drupal Services Italy | Twitter
That would be really sweet.
That would be really sweet.
I agree. And even if you
I agree.
And even if you dont run into problems like that - you dont wanna have a messed up database (when testing some modules that you dont need anymore for example)
--
http://boris-pieper.de
After exactly 6 years this
After exactly 6 years of this proposal, we still have the same problem in Drupal 6.
I have uninstalled numerous Drupal modules and when I check the DB, there still are tables associated to these modules. The module files are not even in the sites/all/modules folder.
In one instance the module was even removed by the Uninstall option.
So, will there be a strict rule to developers (for Drupal 7) to implement proper uninstallation code?
Is it safe to remove those tables manually?
Uninstall
This shouldn't be a problem in Drupal 7 - as long as the tables were created using a hook_schema implementation, the system will automatically remove the tables when the module is uninstalled. There's no real excuse for Drupal 6 developers not doing so either, as removing your tables is as simple as adding a
drupal_uninstall_schema('mymodule');call to the uninstall hook.However, as a sidebar, it's worth noting that module tables (and settings) are supposed to persist until the module is "even removed by the Uninstall option". Disabling the module only stops it actively functioning - the intent is that you can disable and later re-enable a module without losing any accomulated data or painstakingly-configured settings. Also, removing the module files manually has no effect on the database tables (and basically prevents the system from ever removing the tables, as without those files it's unaware that the tables exist). The correct procedure is
Disable module > Uninstall module > Remove module files
(Note that not all modules provide the "Uninstall" step, but if present it should be taken.)
If after you've done that the tables persist, and you're sure that the tables were created by the modules you've removed, it should be fine to remove them manually. Unless you decide to use the module again later - at which point Drupal will not re-run the installation process (because it'll remember the module was never uninstalled), and will not create the tables again, so you'll have to do that by hand too.
--Andy
Developing Drupal websites for Livelink New Media