You are here

function og_update_7100 in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og.install \og_update_7100()

Add indexes to og and og_membership tables.

File

./og.install, line 725
Install, update, and uninstall functions for the Organic groups module.

Code

function og_update_7100(&$sandbox) {

  // Make sure we don't try to re-add an index that was added in previous
  // updates.
  if (!db_index_exists('og_membership', 'entity')) {
    db_add_index('og_membership', 'entity', array(
      'etid',
      'entity_type',
    ));
  }
  if (!db_index_exists('og_membership', 'gid')) {
    db_add_index('og_membership', 'gid', array(
      'gid',
    ));
  }
  if (!db_index_exists('og', 'entity')) {
    db_add_index('og', 'entity', array(
      'etid',
      'entity_type',
    ));
  }
  return t('Added table indexes for the following tables: @tables', array(
    '@tables' => 'og, og_membership',
  ));
}