Unable to Install/Uninstall a custom module I am new to Drupal development and was working on a module. It has since gotten entirely screwed up. This is in Drupal 7. The module was adding a field type with a widget and some theming. It also created several new tables.

My module does not show up in the module list, and it does not show up in the uninstall list either. I see that it is still listed in the system table, and I had manually disabled it there (and did the clearing in the cache_bootstrap table). I removed the entire module folder at one point and have tried with it there and not there, clearing cache at each step. 

Though I could live with the module still being "in the system", I would greatly prefer not to. I also have the major problem of I can not create a module with that name anymore as adding in a folder (even with a new, much simpler codebase for the module) does not make it show up in the list. To make matters worse this is a group project so it is not as if I could just start with a clean install of Drupal and start over.

So I am curious how I could remove the existing module so that I am able to "start over" with my own module?

Thanks!
You should pay close attention to the Module developer's guide on Drupal.org.

To appear in the lists, the module should be placed in its own sub-directory like modules/modulename, and it must have a properly configured modulename.info file in addition to a file named modulename.module. 

If you have properly segregated the functions into the proper files, there should be no problem. Drupal will detect them automatically and will maintain an entry in the system table for the module. You should be able to activate or deactivate the module normally.

The installation routines (which are used to create or to remove the tables should be handled by functions in a modulename.install file. Drupal will look for the modulename.install file to see what tasks are required for installation or removal of the module.

My first advice would be to make sure that the module is correctly structured, and let Drupal handle the deactivation and uninstall, but you can do it manually if all else fails.

Deactivate the module and drop the tables using queries directly on the database. Start by looking for the definition in the system table.

UPDATE system SET status=0 WHERE type='module' AND name = 'modulename';


Then manually DROP any tables your module created and remove any variables it created.