You are here

function user_badges_update_2 in User Badges 5

Implementation of hook_update_N() add primary key

This is problematic because the previous update_N is incosistent with the intall DB. So some users will get errors from this.

File

./user_badges.install, line 131
@brief User Badges install file

Code

function user_badges_update_2() {
  $done = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $done[] = db_query('
        ALTER TABLE {user_badges_badges}
        ADD PRIMARY KEY (bid)
      ');
      break;
    default:
      break;
  }
  return $done;
}