Skip to content
This repository has been archived by the owner on May 4, 2023. It is now read-only.

Commit

Permalink
- Patch #853896 by Stevel: type field is part of primary key but not …
Browse files Browse the repository at this point in the history
…marked as NOT NULL.
  • Loading branch information
dries committed Aug 11, 2010
1 parent de34fba commit fa6f2f3
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions modules/search/search.install
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// $Id: search.install,v 1.27 2009-12-04 16:49:47 dries Exp $
// $Id: search.install,v 1.28 2010-08-11 02:14:23 dries Exp $

/**
* @file
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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'));
}

0 comments on commit fa6f2f3

Please sign in to comment.