i think every module that changes stuff in the drupal database should not only have an install script (how to add tables, move the module, configure in admin interface, pref in standard format) but also how to *deinstall* the module. not just remove the module from the directory but also the required mysql statements to remove the tables.
looking at my show tables, there are still a lot of deinstalled tables which should have been removed. now i can do that with some mysql info, but it should be standard in the install document
exapmle 'template' of nstall document
* what does the module do (functionlaity)
* what dos one have to do to install the module
- copy to modules dir
- insert tables
- where what to configure in the admin module
* deinstall
-remove module
-delete tables
my dime
Comments
What if uninstall was a module itself?
If modules had a function that returned what tables and columns they use, an uninstall module (or a simple function inside system.module) could simple drop them if they are unique to the module being uninstalled and delete the .module file.
A simple hook like:
Just a thought
great idea
this db_info hook! automatic install/update/uninstall, suited for different DBS, ... - many uses. anyone else thinking so?
Hmmm.......
Yes, I like this to. I once did a suggestion for this but it didn't made it till this far...
Yep, like it too.
I like this a lot. It keeps the installation clean and makes it easy to try modules.
The problems I see
I'm more in favor of each module having a hook where it can detail how to uinstall the module, with the necessary SQL commands etc. That way the user has to do some manual work to clean things up.
--
Kjartan
Running from the command line
These problems can be addressed by only allowing the php deinstallation scripts to run from the command line.
But,
Then you end up with complaints from people who have hosts who don't let them have shell access.
Supporting applications running on unlimited systems and configurations can be hard sometimes
--
Kjartan
Also,
the database info specified in conf.php may not have the required privileges to delete fields and/or tables, so that's also a problem.
I'm more in favor of Kjartan's idea.