You are here

function heartbeat_update_402 in Heartbeat 6.4

Update to version 4.6

Return value

sql statements array

File

./heartbeat.install, line 394
Installation file for the heartbeat module. @author Jochen Stals - Menhir - www.menhir.be

Code

function heartbeat_update_402() {

  // Add the translations table for multilingual comments
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("CREATE TABLE {heartbeat_translations} (uaid int(11), tuaid int(11))");
      $result = db_query("SELECT * FROM {heartbeat_messages}");
      while ($row = db_fetch_object($result)) {
        switch ($row->custom) {
          case 2:
            $custom = 4;
            break;
          case 1:
            $custom = 2;
            break;
          case 0:
          default:
            $custom = 1;
        }
        $ret[] = update_sql("UPDATE {heartbeat_messages} SET custom = {$custom} WHERE hid = " . $row->hid);
      }
      break;
  }
  return $ret;
}