function hosting_web_server_update_6000 in Hosting 7.4
Same name and namespace in other branches
- 6.2 web_server/hosting_web_server.install \hosting_web_server_update_6000()
- 7.3 web_server/hosting_web_server.install \hosting_web_server_update_6000()
Implements hook_update_N().
Move a lot of fields to the hosting_server table.
File
- web_server/
hosting_web_server.install, line 36 - Update functions for the hosting_web_server module.
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;
}