From e9011a8c5525678c1574d59d243af17fca16e9ae Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Mon, 12 May 2014 13:55:23 +0200 Subject: adding unit tests for encryption data migration --- apps/files_encryption/appinfo/update.php | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'apps/files_encryption/appinfo') 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 @@ 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(); } -- cgit v1.2.3