summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/appinfo
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-05-12 13:55:23 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-06-05 16:54:04 +0200
commite9011a8c5525678c1574d59d243af17fca16e9ae (patch)
tree9af30283488e6f4eed1bd0589654a2d16a6dbd77 /apps/files_encryption/appinfo
parenteb29b2984cf81f25df42d59ce1d5c9a9b307763c (diff)
downloadnextcloud-server-e9011a8c5525678c1574d59d243af17fca16e9ae.tar.gz
nextcloud-server-e9011a8c5525678c1574d59d243af17fca16e9ae.zip
adding unit tests for encryption data migration
Diffstat (limited to 'apps/files_encryption/appinfo')
-rw-r--r--apps/files_encryption/appinfo/update.php19
1 files changed, 5 insertions, 14 deletions
diff --git a/apps/files_encryption/appinfo/update.php b/apps/files_encryption/appinfo/update.php
index 48262cffa11..a29667ec6b6 100644
--- a/apps/files_encryption/appinfo/update.php
+++ b/apps/files_encryption/appinfo/update.php
@@ -1,19 +1,10 @@
<?php
-$installedVersion=OCP\Config::getAppValue('files_encryption', 'installed_version');
-// migrate settings from oc_encryption to oc_preferences
-if (version_compare($installedVersion, '0.6', '<')) {
- $sql = 'SELECT * FROM `*PREFIX*encryption`';
- $query = \OCP\DB::prepare($sql);
- $result = $query->execute(array())->fetchAll();
-
- foreach ($result as $row) {
- \OC_Preferences::setValue($row['uid'], 'files_encryption', 'recovery_enabled', $row['recovery_enabled']);
- \OC_Preferences::setValue($row['uid'], 'files_encryption', 'migration_status', $row['migration_status']);
- }
+use OCA\Files_Encryption\Migration;
- $deleteOldTable = 'DROP TABLE `*PREFIX*encryption`';
- $query = \OCP\DB::prepare($deleteOldTable);
- $query->execute(array());
+$installedVersion=OCP\Config::getAppValue('files_encryption', 'installed_version');
+if (version_compare($installedVersion, '0.6', '<')) {
+ $m = new Migration();
+ $m->dropTableEncryption();
}