diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-19 11:58:48 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2014-02-19 11:58:48 +0100 |
commit | 7330f61a947f94865ab3d934bd1d4c425c737b38 (patch) | |
tree | b8408e41aaa2df79cf7e1e6a72ff073d0ca5c978 /apps/files/appinfo | |
parent | bcad6e641a238cc3cfc202d587242b9c3bb45d8b (diff) | |
parent | 9ae829497a3e3a4ef535e9ed18f59233c0a4aa35 (diff) | |
download | nextcloud-server-7330f61a947f94865ab3d934bd1d4c425c737b38.tar.gz nextcloud-server-7330f61a947f94865ab3d934bd1d4c425c737b38.zip |
Merge pull request #4799 from owncloud/tune_legacy_cache_webdav_properties_prefixing_master
Concatenate string in SQL instead of PHP
Diffstat (limited to 'apps/files/appinfo')
-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 |