| 14 |
$schema['nodevote'] = array( |
$schema['nodevote'] = array( |
| 15 |
'description' => t('Stores the users\' votes about a node'), |
'description' => t('Stores the users\' votes about a node'), |
| 16 |
'fields' => array( |
'fields' => array( |
| 17 |
|
'nvid' => array( |
| 18 |
|
'description' => t('Nodevote ID'), |
| 19 |
|
'type' => 'serial', |
| 20 |
|
'unsigned' => TRUE, |
| 21 |
|
'not null' => TRUE, |
| 22 |
|
), |
| 23 |
'uid' => array( |
'uid' => array( |
| 24 |
'description' => t('User ID'), |
'description' => t('User ID'), |
| 25 |
'type' => 'int', |
'type' => 'int', |
| 46 |
'not null' => TRUE, |
'not null' => TRUE, |
| 47 |
), |
), |
| 48 |
), |
), |
| 49 |
'primary key' => array('uid', 'nid'), |
'primary key' => array('nvid'), |
| 50 |
'indexes' => array('node_nid' => array('nid'), 'user_id' => array('uid')), |
'indexes' => array('node_nid' => array('nid'), 'user_id' => array('uid')), |
| 51 |
); |
); |
| 52 |
return $schema; |
return $schema; |
| 64 |
} |
} |
| 65 |
|
|
| 66 |
/** |
/** |
| 67 |
|
* Add new column, set it as primary key, drop old primary keys |
| 68 |
|
*/ |
| 69 |
|
function nodevote_update_6001() { |
| 70 |
|
$ret = array(); |
| 71 |
|
db_drop_primary_key($ret, 'nodevote'); |
| 72 |
|
$field = array( |
| 73 |
|
'description' => t('Nodevote ID'), |
| 74 |
|
'type' => 'serial', |
| 75 |
|
'unsigned' => TRUE, |
| 76 |
|
'not null' => TRUE, |
| 77 |
|
); |
| 78 |
|
db_add_field($ret, 'nodevote', 'nvid', $field, array('primary key' => array('nvid'))); |
| 79 |
|
return $ret; |
| 80 |
|
} |
| 81 |
|
|
| 82 |
|
/** |
| 83 |
* Implementation of hook_uninstall(). |
* Implementation of hook_uninstall(). |
| 84 |
*/ |
*/ |
| 85 |
function nodevote_uninstall() { |
function nodevote_uninstall() { |