public function setUp() { if (OC_DB::tableExists('encryption_test')) { OC_DB::dropTable('encryption_test'); } $this->assertTableNotExist('encryption_test'); }
protected function tearDown() { // do not drop the table for Oracle as it will create a bogus transaction // that will break the following test suites requiring transactions if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') { \OC_DB::dropTable('table'); } parent::tearDown(); }
public function setUp() { $this->loginHelper(self::TEST_ENCRYPTION_MIGRATION_USER1); $this->view = new \OC\Files\View(); $this->public_share_key_id = \OCA\Files_Encryption\Helper::getPublicShareKeyId(); $this->recovery_key_id = \OCA\Files_Encryption\Helper::getRecoveryKeyId(); if (\OC_DB::tableExists('encryption_test')) { \OC_DB::dropTable('encryption_test'); } $this->assertTableNotExist('encryption_test'); }
public function dropTableEncryption() { $tableName = $this->tableName; if (!\OC_DB::tableExists($tableName)) { return; } $sql = "select `uid`, max(`recovery_enabled`) as `recovery_enabled`, min(`migration_status`) as `migration_status` from `*PREFIX*{$tableName}` group by `uid`"; $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']); } \OC_DB::dropTable($tableName); }
<?php /** * @author Björn Schießle <*****@*****.**> * @author Christopher Schäpers <*****@*****.**> * @author Morris Jobke <*****@*****.**> * @author Thomas Müller <*****@*****.**> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see <http://www.gnu.org/licenses/> * */ $installedVersion = OCP\Config::getAppValue('files_trashbin', 'installed_version'); if (version_compare($installedVersion, '0.6', '<')) { //size of the trash bin could be incorrect, remove it for all users to //enforce a recalculation during next usage. \OC_DB::dropTable('files_trashsize'); }
<?php /** * @author Björn Schießle <*****@*****.**> * @author Thomas Müller <*****@*****.**> * @author Victor Dubiniuk <*****@*****.**> * * @copyright Copyright (c) 2015, ownCloud, Inc. * @license AGPL-3.0 * * This code is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License, version 3, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License, version 3, * along with this program. If not, see <http://www.gnu.org/licenses/> * */ $installedVersion = OCP\Config::getAppValue('files_versions', 'installed_version'); // move versions to new directory if (version_compare($installedVersion, '1.0.4', '<')) { \OC_DB::dropTable("files_versions"); } // Cron job for deleting expired trash items \OC::$server->getJobList()->add('OCA\\Files_Versions\\BackgroundJob\\ExpireVersions');
protected static function dropTestTable() { if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') { \OC_DB::dropTable('table'); } }
public function tearDown() { \OC_DB::dropTable('table'); }