You are here

function hosting_web_server_update_6000 in Hosting 6.2

Same name and namespace in other branches
  1. 7.4 web_server/hosting_web_server.install \hosting_web_server_update_6000()
  2. 7.3 web_server/hosting_web_server.install \hosting_web_server_update_6000()

Move a lot of fields to the hosting_server table.

File

web_server/hosting_web_server.install, line 22

Code

function hosting_web_server_update_6000() {
  $ret = array();

  // THIS IS A MYSQL-ism, but we need it at this point.
  db_query("INSERT INTO {hosting_service} (nid, vid, service, type, restart_cmd, port, available) SELECT nid, vid, 'http', 'apache', restart_cmd, 80, 1 FROM {hosting_web_server}");
  db_query("INSERT INTO {hosting_server} (nid, vid) SELECT nid, vid FROM {hosting_web_server}");
  db_query("UPDATE {node} SET type='server' WHERE type='web_server'");
  db_drop_field($ret, "hosting_web_server", "ip_address");
  db_drop_field($ret, "hosting_web_server", "script_user");
  db_drop_field($ret, "hosting_web_server", "backup_path");
  db_drop_field($ret, "hosting_web_server", "config_path");
  db_drop_field($ret, "hosting_web_server", "drush_path");
  return $ret;
}