0

Possible Duplicate:
hook_schema is not creating database table

I am developing a module in Drupal 7. It is called scorm. I created scorm.install file, where I wanted to create the necessary tables, when the module is being installed. For testing I used book module: I installed it and 'book' table was created.

So I took the code from book.install, renamed all the functions prefixes from 'book_' to 'scorm_' and tried to install my module. I added this code to scorm_schema function:

function scorm_schema() {
    print 123;exit;

And 123 was printed when installing. So I removed this test code, being sure, that the hook is called.

But the book table was not created! How can I debug and find out the cause of problem?

2
0

Book table was created after I disabled and uninstalled the module. Then enabled it again, using this set of commands:

drush pm-disable 'scorm'
drush pm-install 'scorm'
drush en 'scorm'
0

hook_schema() should return an array that defines a database schema.

1
  • I return it. So, this is fine. – user4035 Jul 3 '12 at 9:28

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