View source
<?php
function plus1_install() {
drupal_install_schema('plus1');
}
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;
}
function plus1_uninstall() {
drupal_uninstall_schema('plus1');
}