Hi,

I have practically copied the custom module from Drupal Pro Development to the point where it is supposed to install a table for the module into the database on hook_install.

It doesn't create a new table.
I've search about and tried to install on hook_enable too, but nothing works.

I have dropped the DB.
Put in a fresh one.
Tried to install.... and the tables are not created.

So I have totally no clue why this isn't working.
I've zipped up the code and if someone can tell me what I have done wrong then that would be great.

Thanks,
Ben.

CommentFileSizeAuthor
steve.zip4.33 KBBensbury
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

VM’s picture

Component: install system » other
Status: Active » Closed (won't fix)

This belongs in the mdoule development forum as it's not a core issue.

aldrenalin’s picture

I had similar symptoms ... a simple install file that wouldn't create a table.
However, I got it to work by going into the Drupal system table and deleting the record for my module.
Then the next time that I enabled my module, Drupal freshly discovered it and ran the .install file to successfully create the table.

Summary. When you have a module already in use (and so it appears in the system table),
and *then* as a developer you create its .install file,
it doesn't look like a *new* installation to Drupal (since the module name was already in the system table), so hook_install never gets called.

ussher’s picture

Thanks aldrenalin,

This is exactly the bit of info that i needed. I couldn't understand why the schema would not install. There was no 'uninstall' because the .install file was not there when the module was first installed. all is well now. Thanks very much.