You are here

function biblio_schema_7300 in Bibliography Module 7.3

Snapshot of the schema for biblio_update_7300().

2 calls to biblio_schema_7300()
biblio_schema in ./biblio.install
Implements hook_schema().
biblio_update_7300 in ./biblio.install
Upgrade Biblio schema to 3.x.

File

./biblio.install, line 47
Install file for the biblio module.

Code

function biblio_schema_7300() {
  $schema['biblio'] = array(
    'fields' => array(
      'bid' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => '',
        'unsigned' => TRUE,
      ),
      'title' => array(
        'description' => 'The title of this Biblio, always treated as non-markup plain text.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'type' => array(
        'description' => 'The publication type of the biblio',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'uid' => array(
        'description' => 'The Drupal user ID who created this biblio.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'created' => array(
        'type' => 'int',
        'not null' => TRUE,
        'description' => '',
      ),
      'changed' => array(
        'type' => 'int',
        'not null' => TRUE,
        'description' => '',
      ),
      'cache_id' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'description' => 'md5 of the style name and style options.',
      ),
      'cache' => array(
        'type' => 'text',
        'size' => 'big',
        'not null' => FALSE,
        'description' => 'The full HTML cache of the rendered Biblio, per its cache ID.',
      ),
      'md5' => array(
        'type' => 'varchar',
        'length' => '32',
        'not null' => FALSE,
        'description' => '',
      ),
    ),
    'primary key' => array(
      'bid',
    ),
    'indexes' => array(
      'bid' => array(
        'bid',
      ),
    ),
  );
  $schema['biblio_contributor'] = array(
    'description' => 'Contains contributor 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',
      ),
      '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' => '',
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the entry was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'changed' => array(
        'description' => 'The Unix timestamp when the entry was most recently saved.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'foreign keys' => array(
      'biblio_contributor' => array(
        'table' => 'biblio_contributor',
        'columns' => array(
          'cid' => 'cid',
        ),
      ),
    ),
    'primary key' => array(
      'cid',
    ),
    'indexes' => array(
      'lastname' => array(
        'lastname',
      ),
      'firstname' => array(
        'firstname',
      ),
      'initials' => array(
        'initials',
      ),
    ),
  );
  $schema['biblio_type'] = array(
    'description' => 'Stores information about the biblio types.',
    'fields' => array(
      'type' => array(
        'description' => 'The machine-readable name of this type.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => 'The human-readable name of this type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'translatable' => TRUE,
      ),
      'description' => array(
        'description' => 'A brief description of this type.',
        'type' => 'text',
        'not null' => TRUE,
        'size' => 'medium',
        'translatable' => TRUE,
      ),
    ),
    'primary key' => array(
      'type',
    ),
  );
  return $schema;
}