summaryrefslogtreecommitdiffstats
path: root/apps/files/appinfo/update.php
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-21 14:05:08 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-21 14:05:08 +0100
commit6ff96b34ad0462ad05c34633ccd08236b93bf195 (patch)
tree1acd7eb869d512b5a3fc9502961a98591ea20cfa /apps/files/appinfo/update.php
parente139f7c863d5971a6386070148496cb0f70ad04e (diff)
parent37af74efb3e3511b2d6eacef67dc90f22a685bd3 (diff)
downloadnextcloud-server-6ff96b34ad0462ad05c34633ccd08236b93bf195.tar.gz
nextcloud-server-6ff96b34ad0462ad05c34633ccd08236b93bf195.zip
Merge branch 'master' into load-apps-proper-master
Conflicts: apps/files/ajax/rawlist.php cron.php ocs/v1.php
Diffstat (limited to 'apps/files/appinfo/update.php')
-rw-r--r--apps/files/appinfo/update.php19
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