You are here

function plus1_schema in Plus 1 6

Same name and namespace in other branches
  1. 6.2 plus1.install \plus1_schema()

Implementation of hook_schema().

File

./plus1.install, line 12

Code

function plus1_schema() {
  $schema['plus1_vote'] = array(
    'description' => t('The table used by the Plus1 module.'),
    'fields' => array(
      'uid' => array(
        'description' => t('The primary identifier for the voter.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => t('The node that gets a vote.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'vote' => array(
        'description' => t('The vote.'),
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => FALSE,
        'not null' => FALSE,
      ),
      'created' => array(
        'description' => t('The timestamp of when the voter voted.'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'uid',
      'nid',
    ),
    'indexes' => array(
      'score' => array(
        'vote',
      ),
    ),
  );
  return $schema;
}