Merge pull request #267 from owncloud/improve_files_update

Improve performance of files update (on larger setups)
This commit is contained in:
Thomas Müller 2012-11-05 14:06:07 -08:00
commit b7e9d8d00e
1 changed files with 2 additions and 2 deletions

View File

@ -5,10 +5,10 @@ $installedVersion=OCP\Config::getAppValue('files', 'installed_version');
if (version_compare($installedVersion, '1.1.6', '<')) {
$query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" );
$result = $query->execute();
$updateQuery = OC_DB::prepare('UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?');
while( $row = $result->fetchRow()) {
if ( $row["propertyname"][0] != '{' ) {
$query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' );
$query->execute( array( '{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"] ));
$updateQuery->execute(array('{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"]));
}
}
}