.install file not working properly I am new to Drupal, and I am trying to write a module with an .install file which will create a database table. The table isn't being created (as seen from the error codes when I try to access it. It also doesn't show up in the Schema module listing) and I don't know what I did wrong. Can someone see if they can find the error?

This is the code:

function email_form_schema() {  
  $schema['subscription_info'] = array(
    'description' =&gt; t('The base table for nodes.'),
    'fields' =&gt; array(
      'first' =&gt; array(
        'description' =&gt; t('The first name'),
        'type' =&gt; 'varchar',
        'not null' =&gt; TRUE,
        'default' =&gt; '',
      ),
      'last' =&gt; array(
        'description' =&gt; t('The last name'),
        'type' =&gt; 'varchar',
        'unsigned' =&gt; TRUE,
        'not null' =&gt; TRUE,
        'default' =&gt; '',
      ),
      'email' =&gt; array(
        'description' =&gt; t('The email address'),
        'type' =&gt; 'varchar',
        'length' =&gt; 32,
        'not null' =&gt; TRUE,
        'default' =&gt; ''
      ),
      'phone' =&gt; array(
        'description' =&gt; t('The phone number.'),
        'type' =&gt; 'varchar',
        'length' =&gt; 10,
        'not null' =&gt; TRUE,
        'default' =&gt; '',
      )
     ),
    'primary key' =&gt; array('email'),
  );

  return $schema;
}   

function email_form_install() {
  // Create my tables.
  drupal_install_schema('email_form');
}

function email_form_uninstall() {
  // Drop my tables.
  drupal_uninstall_schema('email_form');
}   


Here's the error when I try to access it:


  user warning: Table 'drupal620x120318224310.subscription_info' doesn't exist query: INSERT INTO subscription_info (first, last, email, phone) VALUES ('','','','') in C:\EasyPHP-5.3.8.1\modules\drupal620x120318224310\sites\all\modules\email_form\email_form.module on line 123.


I was missing the return $schema; line (which I modified above), but it still doesn't work. In the schema module it lists the "subscription_info" table as missing. What does this mean?
If I had a penny for every time I've done this...

You've forgotten to return $schema from your email_form_schema() function.

You'll need to reinstall the module (not just disable then re-enable) for the changes to take effect.  

There's also a problem with the "last" column. It's a "varchar" and you're using the "unsigned" property which isn't compatible with that type.

You also need to provide the "length" property for all of the "varchar" type columns, including "first" and "last".