Commit fcb6c32d authored by Nigel McNie's avatar Nigel McNie
Browse files

An attempt at fixing the failed upgrade from 0.7 to 0.8 due to a key being set...

An attempt at fixing the failed upgrade from 0.7 to 0.8 due to a key being set up before correct values are available
parent eb9a0e2f
......@@ -11,13 +11,18 @@ function xmldb_auth_internal_upgrade($oldversion=0) {
$auth_instance->authname='internal';
$auth_instance->id = insert_record('auth_instance',$auth_instance, 'id', true);
if (!empty($auth_instance->id)) {
return execute_sql("UPDATE {$prefix}usr set authinstance='{$auth_instance->id}'");
if (empty($auth_instance->id)) {
return false;
}
return false;
$table = new XMLDBTable('usr');
$key = new XMLDBKey("authinstancefk");
$key->setAttributes(XMLDB_KEY_FOREIGN, array('authinstance'), 'auth_instance', array('id'));
add_key($table, $key);
return true;
}
return true;
}
?>
\ No newline at end of file
?>
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