<?php
// $Id$

/**
 * Implementation of hook_install().
 */
function example_install() {
  drupal_install_schema('example');
}

/**
 * Implementation of hook_uninstall().
 */
function example_uninstall() {
  drupal_uninstall_schema('example');
}

/**
 * Implementation of hook_schema().
 */
function example_schema() {
  $schema['example'] = array(
    'description' => t('Example database table.'),
    'fields' => array(
      'eid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t('Primary Key: Unique example ID.'),
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('Name.'),
      ),
      'mail' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('E-mail address.'),
      ),
    ),
    'primary key' => array('eid'),
    'unique keys' => array(
      'mail' => array('mail'),
    ),
    'indexes' => array(
      'name' => array('name'),
    ),
  );
  return $schema;
}