You are here

function birthdays_update_1 in Birthdays 5

Implementation of hook_update_N().

File

./birthdays.install, line 35

Code

function birthdays_update_1() {

  // 2007-08-12 for birthdays.install 1.2.2.2: Ensuring weight is lower than the weight of profile.module.
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':

      // fetch current weight of the profile module, decrease with 1;
      $weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'profile'")) - 1;
      $ret[] = update_sql("UPDATE {system} SET weight = %d WHERE name = 'birthdays'", $weight);
      break;
    case 'pgsql':

      // TODO
      break;
  }
  return $ret;
}