#257910 follow-up by Damien Tournoud: Fix location of search.install update code and remove redundant index.

merge-requests/26/head
Angie Byron 2008-11-03 06:33:21 +00:00
parent d0f8f90a36
commit a28f1ad9d2
2 changed files with 16 additions and 17 deletions

View File

@ -89,7 +89,6 @@ function search_schema() {
),
'indexes' => array(
'sid_type' => array('sid', 'type'),
'word' => array('word'),
),
'primary key' => array('word', 'sid', 'type'),
);
@ -152,3 +151,18 @@ function search_schema() {
return $schema;
}
/**
* Replace unique keys in 'search_dataset' and 'search_index' by primary keys.
*/
function search_update_7000() {
$ret = array();
db_drop_unique_key($ret, 'search_dataset', 'sid_type');
db_add_primary_key($ret, 'search_dataset', array('sid', 'type'));
db_drop_index($ret, 'search_index', 'word');
db_drop_unique_key($ret, 'search_index', 'word_sid_type');
db_add_primary_key($ret, 'search_index', array('word', 'sid', 'type'));
return $ret;
}

View File

@ -3096,22 +3096,7 @@ function system_update_7011() {
'permission' => 'bypass node access',
));
}
$insert->execute();
return $ret;
}
/**
* Replace unique keys in 'search_dataset' and 'search_index' by primary keys.
*/
function system_update_7012() {
$ret = array();
db_drop_unique_key($ret, 'search_dataset', 'sid_type');
db_add_primary_key($ret, 'search_dataset', array('sid', 'type'));
db_drop_index($ret, 'search_index', 'word');
db_drop_unique_key($ret, 'search_index', 'word_sid_type');
db_add_primary_key($ret, 'search_index', array('word', 'sid', 'type'));
$insert->execute();
return $ret;
}