You are here

function patron_schema in Library 6

Same name and namespace in other branches
  1. 5.2 patron/patron.install \patron_schema()
  2. 6.2 patron/patron.install \patron_schema()

@author Jess Straatmann @file patron.install Install and uninstall all required databases. Also do incremental database updates.

File

patron/patron.install, line 10
@author Jess Straatmann patron.install Install and uninstall all required databases. Also do incremental database updates.

Code

function patron_schema() {
  $schema['library_patrons'] = array(
    'description' => t('The table where patron information is stored.'),
    'fields' => array(
      'nid' => array(
        'description' => t('The primary identifier for a node.'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'name_last' => array(
        'description' => t('The patron last name.'),
        'type' => 'varchar',
        'length' => 60,
        'not null' => TRUE,
        'default' => '',
      ),
      'name_first' => array(
        'description' => t('The patron first name.'),
        'type' => 'varchar',
        'length' => 60,
        'not null' => TRUE,
        'default' => '',
      ),
      'email' => array(
        'description' => t('The patron email.'),
        'type' => 'varchar',
        'length' => 60,
        'not null' => TRUE,
        'default' => '',
      ),
      'patron_uid' => array(
        'description' => t('Drupal user id of the user corresponding to this patron.'),
        'type' => 'int',
        'not null' => FALSE,
        'unsigned' => TRUE,
        'default' => NULL,
      ),
      'barcode' => array(
        'description' => t('Card number for this patron.'),
        'type' => 'varchar',
        'length' => 60,
        'not null' => FALSE,
        'default' => '',
      ),
      'disabled' => array(
        'description' => t('Boolean indicating whether the patron account is disabled.'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'indexes' => array(),
    'unique keys' => array(
      'email' => array(
        'email',
      ),
      'patron_uid' => array(
        'patron_uid',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}