You are here

function biblio_schema in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 biblio.install \biblio_schema()
  2. 7.3 biblio.install \biblio_schema()
  3. 7 biblio.install \biblio_schema()
  4. 7.2 biblio.install \biblio_schema()

Implements hook_schema().

The indentation in biblio_schema() slighlty varies from Drupal coding conventions, but has been adjusted so all indetion here is consistent.

Return value

array An associative array with data base table schemas defined for the biblio module keyed by the name of the data base tble.

9 calls to biblio_schema()
biblio_reset_types in ./biblio.install
Helper function to reset all field defintions to their defaults.
biblio_update_6000 in ./biblio.install
Update ...
biblio_update_6011 in ./biblio.install
Update ...
biblio_update_6025 in ./biblio.install
Update ...
biblio_update_6040 in ./biblio.install

... See full list

File

./biblio.install, line 347
Install, update, and uninstall functions for the biblio module.

Code

function biblio_schema() {
  $schema['biblio'] = array(
    // @todo: Missing description?
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => '',
      ),
      'vid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => '',
      ),
      'biblio_type' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => '',
      ),
      'biblio_number' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_other_number' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_sort_title' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '64',
        'description' => 'A normalized version of the title, used for sorting on titles. (only first 64 characters saved)',
      ),
      'biblio_secondary_title' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_tertiary_title' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_edition' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_publisher' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_place_published' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_year' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 9999,
        'description' => '',
      ),
      'biblio_volume' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_pages' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_date' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '64',
        'description' => '',
      ),
      'biblio_isbn' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_lang' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '24',
        'default' => 'eng',
        'description' => '',
      ),
      'biblio_abst_e' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_abst_f' => array(
        'not null' => FALSE,
        'type' => 'text',
        'description' => '',
      ),
      'biblio_full_text' => array(
        'type' => 'int',
        'not null' => FALSE,
        'default' => 0,
        'description' => '',
      ),
      'biblio_url' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_issue' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_type_of_work' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_accession_number' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_call_number' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_notes' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_custom1' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_custom2' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_custom3' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_custom4' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_custom5' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_custom6' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_custom7' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_research_notes' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_number_of_volumes' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_short_title' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_alternate_title' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_original_publication' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_reprint_edition' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_translated_title' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_section' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_citekey' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_coins' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_doi' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_issn' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '128',
        'description' => '',
      ),
      'biblio_auth_address' => array(
        'type' => 'text',
        'not null' => FALSE,
        'description' => '',
      ),
      'biblio_remote_db_name' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_remote_db_provider' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_label' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_access_date' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => '',
      ),
      'biblio_refereed' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '20',
        'description' => '',
      ),
      'biblio_md5' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '32',
        'description' => '',
      ),
      'biblio_formats' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'description' => '',
        'serialize' => TRUE,
      ),
    ),
    'foreign keys' => array(
      'node_revision' => array(
        'table' => 'node_revision',
        'columns' => array(
          'vid' => 'vid',
        ),
      ),
      'node' => array(
        'table' => 'node',
        'columns' => array(
          'nid' => 'nid',
        ),
      ),
      'biblio_type' => array(
        'table' => 'biblio_types',
        'columns' => array(
          'biblio_type' => 'tid',
        ),
      ),
    ),
    'primary key' => array(
      'vid',
    ),
    'indexes' => array(
      'nid' => array(
        'nid',
      ),
      'md5' => array(
        'biblio_md5',
      ),
      'year' => array(
        'biblio_year',
      ),
      'title_sort' => array(
        'biblio_sort_title',
      ),
      'date' => array(
        'biblio_date',
      ),
    ),
  );
  $schema['biblio_fields'] = array(
    // @todo: Missing description?
    'fields' => array(
      'fid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{biblio_fields}.fid of the node',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => 'textfield',
      ),
      'size' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 60,
      ),
      'maxsize' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 255,
      ),
    ),
    'primary key' => array(
      'fid',
    ),
  );
  $schema['biblio_field_type'] = array(
    'description' => 'Relational table linking {biblio_fields} with {biblio_field_type_data}',
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{biblio_types}.tid of the node',
      ),
      'fid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{biblio_fields}.fid of the node',
      ),
      'ftdid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{biblio_field_type_data}.ftdid of the node, points to the current data, default or custom',
      ),
      'cust_tdid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'This always points to the custom data for this field. Stored so we can switch back an forth between default and custom',
      ),
      'common' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'autocomplete' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
      ),
      'required' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'Is input required for this field',
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The weight (location) of the field on the input form',
      ),
      'visible' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'Determines if the field is visible on the input form',
      ),
    ),
    'primary key' => array(
      'tid',
      'fid',
    ),
    'indexes' => array(
      'tid' => array(
        'tid',
      ),
    ),
  );
  $schema['biblio_field_type_data'] = array(
    'description' => 'Data used to build the form elements on the input form',
    'fields' => array(
      'ftdid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{biblio_field_type_data}.ftdid of the node',
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
        'description' => 'The title, which will be displayed on the form, for a given field',
      ),
      'hint' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'description' => 'The hint text printed below the input widget',
      ),
    ),
    'primary key' => array(
      'ftdid',
    ),
  );
  $schema['biblio_types'] = array(
    // @todo: Missing description?
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => '{biblio_types}.tid of the publication type',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '64',
        'not null' => TRUE,
        'default' => '',
        'description' => 'The name of the publication type',
      ),
      'description' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => '255',
        'description' => 'Description of the publication type',
      ),
      'weight' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Controls the order the types are listed in',
      ),
      'visible' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 1,
        'description' => 'Determines if the publication type is visible in the list',
      ),
    ),
    'primary key' => array(
      'tid',
    ),
  );
  $schema['biblio_contributor'] = array(
    'description' => 'Relational table linking authors to biblio entries',
    'fields' => array(
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{node}.nid of the node',
      ),
      'vid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{node}.vid of the node',
      ),
      'cid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '{biblio_contributor_data}.cid of the node',
      ),
      'auth_type' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 1,
        'description' => '{biblio_contributor_type}.auth_type of the node',
      ),
      'auth_category' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 1,
        'description' => '',
      ),
      'rank' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'Position of the author name on the publication (first,second,third...)',
      ),
      'merge_cid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'unsigned' => TRUE,
        'description' => '',
      ),
    ),
    'foreign keys' => array(
      'node_revision' => array(
        'table' => 'node_revision',
        'columns' => array(
          'vid' => 'vid',
        ),
      ),
      'node' => array(
        'table' => 'node',
        'columns' => array(
          'nid' => 'nid',
        ),
      ),
      'biblio_contributor_data' => array(
        'table' => 'biblio_contributor_data',
        'columns' => array(
          'cid' => 'cid',
        ),
      ),
      'biblio_contributor_type' => array(
        'table' => 'biblio_contributor_type',
        'columns' => array(
          'auth_type' => 'auth_type',
        ),
      ),
      'biblio_contributor_category' => array(
        'table' => 'biblio_contributor_type',
        'columns' => array(
          'auth_category' => 'auth_category',
        ),
      ),
    ),
    'primary key' => array(
      'vid',
      'cid',
      'auth_type',
      'rank',
    ),
  );
  $schema['biblio_contributor_data'] = array(
    'description' => 'Contains Author information for each publication',
    'fields' => array(
      'cid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => 'Primary Key: Author ID',
      ),
      'aka' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'unsigned' => TRUE,
        'description' => 'Also known as, links this author entry with others so you can have variation on the name, but listing by cid will find all other (aka) author entries',
      ),
      'alt_form' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'unsigned' => TRUE,
        'description' => 'Alternate form of an author name, this value points to the desired form (cid), this form is kept in the database so  that future imports of the same name will not create a new author.',
      ),
      'drupal_uid' => array(
        'type' => 'int',
        'not null' => FALSE,
        'unsigned' => TRUE,
        'description' => 'Drupal User ID',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Full name',
      ),
      'lastname' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
        'description' => 'Author last name',
      ),
      'firstname' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => FALSE,
        'default' => '',
        'description' => 'Author first name',
      ),
      'prefix' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => FALSE,
        'default' => '',
        'description' => 'Author name prefix',
      ),
      'suffix' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => FALSE,
        'default' => '',
        'description' => 'Author name suffix',
      ),
      'initials' => array(
        'type' => 'varchar',
        'length' => '10',
        'not null' => FALSE,
        'default' => '',
        'description' => 'Author initials (including first name initial)',
      ),
      'affiliation' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'default' => '',
        'description' => 'Author affiliation or address',
      ),
      'literal' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'unsigned' => TRUE,
        'description' => 'Determines if the author name is allowed to be reformated by the variaous styles or should be used literally.',
      ),
      'md5' => array(
        'type' => 'varchar',
        'length' => '32',
        'not null' => FALSE,
        'description' => '',
      ),
    ),
    'foreign keys' => array(
      'biblio_contributor' => array(
        'table' => 'biblio_contributor',
        'columns' => array(
          'cid' => 'cid',
        ),
      ),
      'node_author' => array(
        'table' => 'users',
        'columns' => array(
          'drupal_uid' => 'uid',
        ),
      ),
    ),
    'primary key' => array(
      'cid',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
      'lastname' => array(
        'lastname',
      ),
      'firstname' => array(
        'firstname',
      ),
      'initials' => array(
        'initials',
      ),
    ),
  );
  $schema['biblio_contributor_aka_data'] = $schema['biblio_contributor_data'];
  $schema['biblio_contributor_aka_data']['description'] = 'Contains Alternate Author information for each publication';
  $schema['biblio_contributor_type'] = array(
    'description' => 'Contains definitions of the contributor types',
    'fields' => array(
      'auth_category' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'There are 5 catagoies of author: Primary, Secondary, Tertiery, Subsidary and Corporate  ',
      ),
      'biblio_type' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => '',
      ),
      'auth_type' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'This is the pulication type specific verion of a particular catagory',
      ),
    ),
    'foreign keys' => array(
      'biblio' => array(
        'table' => 'biblio',
        'columns' => array(
          'biblio_type' => 'biblio_type',
        ),
      ),
      'biblio_contributor_type' => array(
        'table' => 'biblio_contributor',
        'columns' => array(
          'auth_type' => 'auth_type',
        ),
      ),
      'biblio_contributor_category' => array(
        'table' => 'biblio_contributor',
        'columns' => array(
          'auth_category' => 'auth_category',
        ),
      ),
    ),
    'primary key' => array(
      'auth_category',
      'biblio_type',
      'auth_type',
    ),
  );
  $schema['biblio_contributor_type_data'] = array(
    'description' => 'Data used to build the form elements on the input form',
    'fields' => array(
      'auth_type' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => '{biblio_contributor_type_data} ctdid of the node',
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
        'description' => 'The title, which will be displayed on the form, for a given field',
      ),
      'hint' => array(
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'description' => 'The hint text printed below the input widget',
      ),
    ),
    'primary key' => array(
      'auth_type',
    ),
  );
  $schema['biblio_keyword'] = array(
    'description' => t('Relational table linking keywords to biblio nodes'),
    'fields' => array(
      'kid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('Primary Key: The {biblio_keyword_data}.kid of the keyword of the node.'),
      ),
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('The {node}.nid of the node.'),
      ),
      'vid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => 'Primary Key: The {node}.vid of the node.',
      ),
    ),
    'foreign keys' => array(
      'node_revision' => array(
        'table' => 'node_revision',
        'columns' => array(
          'vid' => 'vid',
        ),
      ),
      'node' => array(
        'table' => 'node',
        'columns' => array(
          'nid' => 'nid',
        ),
      ),
      'keyword' => array(
        'table' => 'biblio_keyword_data',
        'columns' => array(
          'kid' => 'kid',
        ),
      ),
    ),
    'primary key' => array(
      'kid',
      'vid',
    ),
    'indexes' => array(
      'vid' => array(
        'vid',
      ),
      'nid' => array(
        'nid',
      ),
    ),
  );
  $schema['biblio_keyword_data'] = array(
    'description' => t('Stores the keywords related to nodes.'),
    'fields' => array(
      'kid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'description' => t('Primary Key: The id of the keyword assigned to the node'),
      ),
      'word' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('The keyword'),
      ),
    ),
    'primary key' => array(
      'kid',
    ),
    'indexes' => array(
      'kword' => array(
        'word',
      ),
    ),
  );
  $schema['biblio_collection'] = array(
    'description' => t('Relational table grouping biblio nodes into collections'),
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('Primary Key: The {biblio_collection_data}.cid of the collection'),
      ),
      'vid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('Primary Key: The {node}.vid of the node.'),
      ),
      'pid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('The parent id of the collection'),
      ),
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('The {node}.nid of the node.'),
      ),
    ),
    'primary key' => array(
      'cid',
      'vid',
    ),
    'indexes' => array(
      'pid' => array(
        'pid',
      ),
      'nid' => array(
        'nid',
      ),
    ),
  );
  $schema['biblio_collection_type'] = array(
    'description' => t('Descriptions of the collections.'),
    'fields' => array(
      'cid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('Primary Key: The id of the collection'),
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('The name of the collection'),
      ),
      'description' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => t('The description of the collection'),
      ),
    ),
    'primary key' => array(
      'cid',
    ),
    'indexes' => array(
      'name' => array(
        'name',
      ),
    ),
  );
  $schema['biblio_duplicates'] = array(
    'description' => t('Relational table linking possible duplicate biblio nodes'),
    'fields' => array(
      'vid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('Primary Key: The {biblio}.nid of the original node'),
      ),
      'did' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('The {biblio}.nid of the newly imported node which may be a duplicate.'),
      ),
      'type' => array(
        'type' => 'int',
        'not null' => TRUE,
        'unsigned' => TRUE,
        'default' => 0,
        'description' => t('The type of duplicate 0=biblio, 1=author.'),
      ),
    ),
    'primary key' => array(
      'vid',
      'did',
    ),
    'indexes' => array(
      'did' => array(
        'vid',
      ),
    ),
  );
  $schema['biblio_import_cache'] = array(
    'description' => 'tables used for caching data imported from file and then batch processed',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'unsigned' => TRUE,
      ),
      'session_id' => array(
        'type' => 'varchar',
        'length' => 45,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => t('A collection of data to cache.'),
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  $schema['biblio_type_maps'] = array(
    'description' => 'Table used to store the mapping information between various file formats and the biblio schema',
    'fields' => array(
      'format' => array(
        'description' => 'The import/export file format',
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
      ),
      'type_map' => array(
        'description' => 'The mapping between the publication types in the file format and biblio',
        'type' => 'text',
        'not null' => FALSE,
      ),
      'type_names' => array(
        'description' => 'The human readable names of the publication types',
        'type' => 'text',
        'not null' => FALSE,
      ),
      'field_map' => array(
        'description' => 'The mapping between the fields in the file format and biblio',
        'type' => 'text',
        'not null' => FALSE,
      ),
      'export_map' => array(
        'description' => 'which fields are exported',
        'type' => 'text',
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'format',
    ),
  );
  $schema['cache_biblio_csl_object'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['cache_biblio_csl_object']['description'] = 'Cache table for biblio to store pre-built csl objects.';
  $schema['cache_biblio_csl_object']['fields']['serialized']['default'] = 1;
  return $schema;
}