Skip to content
Snippets Groups Projects
Commit 907dd4d2 authored by Robin Appelman's avatar Robin Appelman
Browse files

some aditional feedback during database upgrade

parent da33229d
No related branches found
No related tags found
No related merge requests found
......@@ -156,7 +156,11 @@ class OC{
$installedVersion=OC_Config::getValue('version','0.0.0');
$currentVersion=implode('.',OC_Util::getVersion());
if (version_compare($currentVersion, $installedVersion, '>')) {
OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/db_structure.xml');
$result=OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/db_structure.xml');
if(!$result){
echo 'Error while upgrading the database';
die();
}
OC_Config::setValue('version',implode('.',OC_Util::getVersion()));
}
......
......@@ -361,6 +361,11 @@ class OC_DB {
$content = file_get_contents( $file );
$previousSchema = self::$schema->getDefinitionFromDatabase();
if (PEAR::isError($previousSchema)) {
$error = $previousSchema->getMessage();
OC_Log::write('core','Failed to get existing database structure for upgrading ('.$error.')',OC_Log::FATAL);
return false;
}
// Make changes and save them to a temporary file
$file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment