Commit 2bbef7be authored by Adrian Rossouw's avatar Adrian Rossouw

clean up the migration code to get rid of inline sql, replacing with hosting_context_register.

parent 52d40793
......@@ -249,7 +249,7 @@ function hosting_update_6008() {
$records[$server_id] = 'server_localhost';
foreach ($records as $nid => $name) {
db_query("INSERT INTO {hosting_context} (nid, name) VALUES (%d, '%s')", $nid, $name);
hosting_context_register($nid, $name);
}
return $return;
}
......
......@@ -17,10 +17,7 @@ function drush_hosting_hostmaster_resume() {
// fix the old platform first
$platform_id = db_result(db_query('SELECT nid FROM {hosting_platform} WHERE publish_path = "%s"', d($old_platform)->root));
if (hosting_context_name($platform_id) != $old_platform) {
db_query("UPDATE {hosting_context} SET name='%s' WHERE nid=%d", ltrim($old_platform, '@'), $platform_id);
}
hosting_context_register($platform_id, ltrim($old_platform, '@'));
// if the new platform doesn't exist, create it.
$platform_root = d()->root;
......@@ -42,11 +39,7 @@ function drush_hosting_hostmaster_resume() {
$platform = node_load($platform_id);
}
// fix the new platform alias name
if (hosting_context_name($platform_id) != $new_platform) {
db_query("UPDATE {hosting_context} SET name='%s' WHERE nid=%d", ltrim($new_platform, '@'), $platform_id);
}
hosting_context_register($platform_id, ltrim($new_platform, '@'));
drush_log('fixing platform for site node');
$node->verified = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment