diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-12 21:55:11 +0400 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-12 21:55:11 +0400 |
commit | 544495563ff1025aca95e9ff39725a844e7fe908 (patch) | |
tree | f081657d3b311cbe77aaaa4c065ce4eff9a11550 /apps/files | |
parent | 6a31fecca33ce9670477009087ae29aa197c3c3f (diff) | |
parent | 3520529430c399e86ae083e7cd7b2bd2e96271e2 (diff) |
Merge pull request #7280 from owncloud/tune_legacy_cache_webdav_properties_prefixing_stable6
Concatenate string in SQL instead of PHP, use doctrine to construct concat expression
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/appinfo/update.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/apps/files/appinfo/update.php b/apps/files/appinfo/update.php index 3503678e7c7..f920f842166 100644 --- a/apps/files/appinfo/update.php +++ b/apps/files/appinfo/update.php @@ -3,17 +3,14 @@ // fix webdav properties,add namespace in front of the property, update for OC4.5 $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] != '{' ) { - $updateQuery->execute(array('{DAV:}' + $row['propertyname'], $row['userid'], $row['propertypath'])); - } - } + $concat = OC_DB::getConnection()->getDatabasePlatform()-> + getConcatExpression( '\'{DAV:}\'', '`propertyname`' ); + $query = OC_DB::prepare(' + UPDATE `*PREFIX*properties` + SET `propertyname` = ' . $concat . ' + WHERE `propertyname` NOT LIKE \'{%\' + '); + $query->execute(); } //update from OC 3 |