Hi Drupal Experts Greetings of the day!!!
I am relatively new to Drupal 7.
I am facing a strange issue. Want to create a table during install of my module. My install file looks as below. My custom module name is resmsubmt. I have tried several hours (with clearing cache etc..), only 1 time I saw the table was created. I deleted that table manually (using phpmyadmin and sql statement). After that I cleared cache, tried with different table names , always I find the table is not created after installing and enabling my module. Drupal shows module is installed successfully, I enable the module, I do not get any error, then why table is not getting created?
Did anybody face this problem anytime? Please let me know what could be the issue here?
--------------------- resmsubmt.install file --------------------------------
<?php function resmsubmt_schema() { $schema['res_sbmt'] = array( 'description' => 'The base tables for resume submission.', 'fields' => array( 'uid' => array( 'description' => 'Id of candidate.', 'type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, ), 'name' => array( 'description' => 'Name of candidate.', 'type' => 'varchar', 'length' => 64, 'not null' => TRUE, 'default' => '', ), ), 'primary key' => array('uid'), );
return $schema; }
function resmsubmt_uninstall() { drupal_uninstall_schema('resmsubmt'); db_query("DROP TABLE res_sbmt"); cache_clear_all('variables', 'cache'); }
Regards Kamal Necs