function flag_update_6201 in Flag 7.3
Same name and namespace in other branches
- 6.2 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 301 - Flag module install/schema/update hooks.
Code
function flag_update_6201() {
// Remove "content type" from one key, see http://drupal.org/node/612602.
db_drop_unique_key('flag_content', 'fid_content_type_content_id_uid');
db_add_unique_key('flag_content', 'fid_content_id_uid', array(
'fid',
'content_id',
'uid',
));
// Add a count index, see http://drupal.org/node/489610.
db_add_index('flag_counts', 'count', array(
'count',
));
}