You are here

function user_badges_update_6102 in User Badges 6.2

Same name and namespace in other branches
  1. 6 user_badges.install \user_badges_update_6102()
  2. 7 user_badges.install \user_badges_update_6102()
  3. 7.2 user_badges.install \user_badges_update_6102()
  4. 7.3 user_badges.install \user_badges_update_6102()

File

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

Code

function user_badges_update_6102() {
  $ret = array();
  db_change_field($ret, 'user_badges_badges', 'image', 'image', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => FALSE,
    'default' => '',
  ));

  //Add the new fields for the on/off checkbox settings
  db_add_field($ret, 'user_badges_badges', 'unhideable', array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
  ));
  db_add_field($ret, 'user_badges_badges', 'fixedweight', array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
  ));
  db_add_field($ret, 'user_badges_badges', 'doesnotcounttolimit', array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
  ));

  //Add the new user weight field
  db_add_field($ret, 'user_badges_user', 'userweight', array(
    'type' => 'int',
    'not null' => FALSE,
  ));
  db_add_index($ret, 'user_badges_user', 'uid_weight', array(
    'uid',
    'userweight',
  ));
  return $ret;
}