function flag_update_6201 in Flag 6.2
Same name and namespace in other branches
- 7.3 flag.install \flag_update_6201()
- 7.2 flag.install \flag_update_6201()
Refine the indexes.
The content type inclusion actually slowed down on unique key. And a count index would be helpful for sorting by counts.
File
- ./
flag.install, line 558 - Flag module install/schema/update hooks.
Code
function flag_update_6201() {
$ret = array();
// Remove "content type" from one key, see http://drupal.org/node/612602.
db_drop_unique_key($ret, 'flag_content', 'fid_content_type_content_id_uid');
db_add_unique_key($ret, 'flag_content', 'fid_content_id_uid', array(
'fid',
'content_id',
'uid',
));
// Add a count index, see http://drupal.org/node/489610.
db_add_index($ret, 'flag_counts', 'count', array(
'count',
));
return $ret;
}