You are here

function messaging_update_6010 in Messaging 6.4

Update destination type

File

./messaging.install, line 381

Code

function messaging_update_6010() {
  $ret = array();
  if (!variable_get('messaging_update_6006', 0) && db_column_exists('messaging_destination', 'method')) {
    foreach (messaging_method_info() as $method => $info) {
      $type = isset($info['address_type']) ? $info['address_type'] : $info['group'];

      // Best guess, will work for most cases
      $ret[] = update_sql("UPDATE {messaging_destination} SET type = '{$type}' WHERE method = '{$method}'");
    }
  }
  return $ret;
}