You are here

function user_badges_update_6102 in User Badges 7.2

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

@todo Please document this function.

See also

http://drupal.org/node/1354

File

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

Code

function user_badges_update_6102() {
  db_change_field('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('user_badges_badges', 'unhideable', array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
  ));
  db_add_field('user_badges_badges', 'fixedweight', array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
  ));
  db_add_field('user_badges_badges', 'doesnotcounttolimit', array(
    'type' => 'int',
    'size' => 'tiny',
    'not null' => TRUE,
    'default' => 0,
  ));

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