From 547fbfdb76cf2094a9f75a73bb7eef385ed97cf6 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Thu, 7 Jan 2016 10:12:08 +0100 Subject: [PATCH] Remove OC_DB::dropTable --- apps/files_trashbin/appinfo/update.php | 6 ------ apps/files_versions/appinfo/update.php | 5 ----- lib/private/db.php | 9 --------- tests/lib/db/connection.php | 2 +- tests/lib/db/mdb2schemamanager.php | 2 +- 5 files changed, 2 insertions(+), 22 deletions(-) diff --git a/apps/files_trashbin/appinfo/update.php b/apps/files_trashbin/appinfo/update.php index bd2ee6bb39..09b1b6931a 100644 --- a/apps/files_trashbin/appinfo/update.php +++ b/apps/files_trashbin/appinfo/update.php @@ -25,12 +25,6 @@ $config = \OC::$server->getConfig(); $installedVersion = $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'); -} - if (version_compare($installedVersion, '0.6.4', '<')) { $isExpirationEnabled = $config->getSystemValue('trashbin_auto_expire', true); $oldObligation = $config->getSystemValue('trashbin_retention_obligation', null); diff --git a/apps/files_versions/appinfo/update.php b/apps/files_versions/appinfo/update.php index ef6772f307..eb04cf090e 100644 --- a/apps/files_versions/appinfo/update.php +++ b/apps/files_versions/appinfo/update.php @@ -20,11 +20,6 @@ * along with this program. If not, see * */ -$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'); diff --git a/lib/private/db.php b/lib/private/db.php index a4a7b7d17d..f339855fb2 100644 --- a/lib/private/db.php +++ b/lib/private/db.php @@ -253,15 +253,6 @@ class OC_DB { return $result; } - /** - * drop a table - the database prefix will be prepended - * @param string $tableName the table to drop - */ - public static function dropTable($tableName) { - $connection = \OC::$server->getDatabaseConnection(); - $connection->dropTable($tableName); - } - /** * remove all tables defined in a database structure xml file * @param string $file the xml file describing the tables diff --git a/tests/lib/db/connection.php b/tests/lib/db/connection.php index ab3b48b259..348a5e31e0 100644 --- a/tests/lib/db/connection.php +++ b/tests/lib/db/connection.php @@ -40,7 +40,7 @@ class Connection extends \Test\TestCase { protected static function dropTestTable() { if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') { - \OC_DB::dropTable('table'); + \OC::$server->getDatabaseConnection()->dropTable('table'); } } diff --git a/tests/lib/db/mdb2schemamanager.php b/tests/lib/db/mdb2schemamanager.php index e194e701d8..470e385b85 100644 --- a/tests/lib/db/mdb2schemamanager.php +++ b/tests/lib/db/mdb2schemamanager.php @@ -24,7 +24,7 @@ class MDB2SchemaManager extends \Test\TestCase { // 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'); + \OC::$server->getDatabaseConnection()->dropTable('table'); } parent::tearDown();