From b45bda8d7b5194c8095ed3266146ce20fc5d560a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Wed, 11 Aug 2010 02:14:23 +0000 Subject: - Patch #853896 by Stevel: type field is part of primary key but not marked as NOT NULL. --- modules/search/search.install | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'modules/search') 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')); } + -- cgit v1.2.3