| 1 |
<?php |
<?php |
| 2 |
// $Id: geshinode.install,v 1.3 2008/01/07 01:20:40 soxofaan Exp $ |
// $Id: geshinode.install,v 1.4 2008/07/21 17:44:23 soxofaan Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 15 |
'fields' => array( |
'fields' => array( |
| 16 |
'nid' => array( |
'nid' => array( |
| 17 |
'description' => t('The primary identifier for a node.'), |
'description' => t('The primary identifier for a node.'), |
| 18 |
'type' => 'serial', |
'type' => 'int', |
| 19 |
'unsigned' => TRUE, |
'unsigned' => TRUE, |
| 20 |
'not null' => TRUE, |
'not null' => TRUE, |
| 21 |
), |
), |
| 34 |
'default' => '', |
'default' => '', |
| 35 |
), |
), |
| 36 |
), |
), |
| 37 |
'primary key' => array('nid'), |
'primary key' => array('vid'), |
| 38 |
'unique keys' => array( |
'indexes' => array('nid' => array('nid')), |
|
'vid' => array('vid'), |
|
|
), |
|
| 39 |
); |
); |
| 40 |
return $schema; |
return $schema; |
| 41 |
} |
} |
| 55 |
// Drop geshinode tables. |
// Drop geshinode tables. |
| 56 |
drupal_uninstall_schema('geshinode'); |
drupal_uninstall_schema('geshinode'); |
| 57 |
} |
} |
| 58 |
|
|
| 59 |
|
|
| 60 |
|
/** |
| 61 |
|
* Implementation of hook_update_N(). |
| 62 |
|
* |
| 63 |
|
* Fix the primary key and indices on the geshinode table. |
| 64 |
|
* See http://drupal.org/node/363770 . |
| 65 |
|
*/ |
| 66 |
|
function geshinode_update_6001() { |
| 67 |
|
$ret = array(); |
| 68 |
|
// Drop unique key on 'vid'. |
| 69 |
|
db_drop_unique_key($ret, 'geshinode', 'vid'); |
| 70 |
|
// Change the 'nid' field to 'int' (from 'serial'). |
| 71 |
|
db_change_field($ret, 'geshinode', 'nid', 'nid', |
| 72 |
|
array( |
| 73 |
|
'description' => t('The primary identifier for a node.'), |
| 74 |
|
'type' => 'int', |
| 75 |
|
'unsigned' => TRUE, |
| 76 |
|
'not null' => TRUE, |
| 77 |
|
) |
| 78 |
|
); |
| 79 |
|
// Drop primary key ('nid'). |
| 80 |
|
db_drop_primary_key($ret, 'geshinode'); |
| 81 |
|
// Add primary key on 'vid'. |
| 82 |
|
db_add_primary_key($ret, 'geshinode', array('vid')); |
| 83 |
|
// Add an index on 'nid'. |
| 84 |
|
db_add_index($ret, 'geshinode', 'nid', array('nid')); |
| 85 |
|
return $ret; |
| 86 |
|
} |