Fix for Installing module tables

  1. <?php
  2. // $Id$
  3.  
  4. /**
  5.  * Make a database schema
  6.  */
  7. function loginhistory_schema()
  8. {      
  9.         $schema = array();
  10.         $schema['loginhistory'] = array(
  11.                 'fields' => array(
  12.                         'uid' => array(
  13.                                 'type' => 'int',
  14.                                 'not null' => TRUE,
  15.                                 'default' => 0,
  16.                                 'disp-width' => '11'
  17.                                 ),
  18.                         'timestamp' => array(
  19.                                 'type' => 'int',
  20.                                 'not null' => TRUE,
  21.                                 'default' => 0,
  22.                                 'disp-width' => '11'
  23.                                 )
  24.                         ),
  25.                 'primary key' => array('uid')
  26.                 );
  27.  
  28.         return $schema;
  29. }
  30.  
  31. /**
  32.  * Install Annotate module
  33.  */
  34. function loginhistory_install()
  35. {
  36.         drupal_install_schema('loginhistory');
  37. }
  38.  
  39. /**
  40. * Implementation of hook_uninstall().
  41. */
  42. function loginhistory_uninstall()
  43. {
  44.         drupal_uninstall_schema('loginhistory');
  45.         //variable_del('annotate_nodetypes');
  46.         //variable_del('annotate_deletion');
  47.         //variable_del('annotate_limit_per_node');
  48.         drupal_set_message(t('Log-in history table dropped. Module is now uninstalled.'));
  49. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.