summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/search/search.install19
1 files changed, 17 insertions, 2 deletions
diff --git a/modules/search/search.install b/modules/search/search.install
index 54d19d1fa..a73afc751 100644
--- a/modules/search/search.install
+++ b/modules/search/search.install
@@ -32,7 +32,7 @@ function search_schema() {
'type' => array(
'type' => 'varchar',
'length' => 16,
- 'not null' => FALSE,
+ 'not null' => TRUE,
'description' => 'Type of item, e.g. node.',
),
'data' => array(
@@ -72,7 +72,7 @@ function search_schema() {
'type' => array(
'type' => 'varchar',
'length' => 16,
- 'not null' => FALSE,
+ 'not null' => TRUE,
'description' => 'The {search_dataset}.type of the searchable item to which the word belongs.',
),
'score' => array(
@@ -155,9 +155,24 @@ function search_schema() {
*/
function search_update_7000() {
db_drop_unique_key('search_dataset', 'sid_type');
+ $dataset_type_spec = array(
+ 'type' => 'varchar',
+ 'length' => 16,
+ 'not null' => TRUE,
+ 'description' => 'Type of item, e.g. node.',
+ );
+ db_change_field('search_dataset', 'type', 'type', $dataset_type_spec);
db_add_primary_key('search_dataset', array('sid', 'type'));
db_drop_index('search_index', 'word');
db_drop_unique_key('search_index', 'word_sid_type');
+ $index_type_spec = array(
+ 'type' => 'varchar',
+ 'length' => 16,
+ 'not null' => TRUE,
+ 'description' => 'The {search_dataset}.type of the searchable item to which the word belongs.',
+ );
+ db_change_field('search_index', 'type', 'type', $index_type_spec);
db_add_primary_key('search_index', array('word', 'sid', 'type'));
}
+