function _hosting_package_temporary_table in Hostmaster (Aegir) 6
2 calls to _hosting_package_temporary_table()
- hosting_migrate_comparison in modules/
hosting/ migrate/ hosting_migrate.module - Compare package schema versions between the current and target platform in temp tables
- hosting_package_comparison in modules/
hosting/ package/ hosting_package.instance.inc
File
- modules/
hosting/ package/ hosting_package.instance.inc, line 264 - API for mapping packages to various Hosting node types
Code
function _hosting_package_temporary_table($ref) {
static $names = array();
if (!isset($names[$ref])) {
// Generate a unique table name for this $ref.
$names[$ref] = '_hosting_comparision_' . trim($ref);
// Create the temporary table.
db_query("CREATE TEMPORARY TABLE %s AS SELECT p.nid, p.short_name, p.old_short_name, i.version_code, i.schema_version, i.version, i.status FROM {hosting_package} p LEFT JOIN {hosting_package_instance} i on p.nid = i.package_id WHERE i.rid = %d", $names[$ref], $ref);
}
return $names[$ref];
}