<?php
// $Id: alt_login.install,v 1.8 2009/10/17 02:10:23 thehunmonkgroup Exp $

/**
 * @file
 * Install, update and uninstall functions for the alt_login module.
 */

/**
* Implementation of hook_schema().
*/
function alt_login_schema() {

  $schema['alt_login'] = array(
    'description' => 'Storage table for alternate user login names.',
    'fields' => array(
      'uid' => array(
        'description' => 'The uid of the user.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'alt_login' => array(
        'description' => 'The alternate login name for the user.',
        'type' => 'varchar',
        'length' => 60,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array('uid'),
    'foreign keys' => array(
      'uid' => array('user' => 'uid'),
    ),
  );

  return $schema;
}

function alt_login_update_last_removed() {
  return 1;
}

/**
 * Implementation of hook_uninstall().
 */
function alt_login_uninstall() {
  // Drop variables.
  $variables = array(
    'alt_login_user_registration',
  );
  foreach ($variables as $variable) {
    variable_del($variable);
  }
}

