Remove OC_DB::dropTable

This commit is contained in:
Morris Jobke 2016-01-07 10:12:08 +01:00
parent 9d3c14c7dd
commit 547fbfdb76
5 changed files with 2 additions and 22 deletions

View File

@ -25,12 +25,6 @@
$config = \OC::$server->getConfig(); $config = \OC::$server->getConfig();
$installedVersion = $config->getAppValue('files_trashbin', 'installed_version'); $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', '<')) { if (version_compare($installedVersion, '0.6.4', '<')) {
$isExpirationEnabled = $config->getSystemValue('trashbin_auto_expire', true); $isExpirationEnabled = $config->getSystemValue('trashbin_auto_expire', true);
$oldObligation = $config->getSystemValue('trashbin_retention_obligation', null); $oldObligation = $config->getSystemValue('trashbin_retention_obligation', null);

View File

@ -20,11 +20,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/> * 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 // Cron job for deleting expired trash items
\OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions'); \OC::$server->getJobList()->add('OCA\Files_Versions\BackgroundJob\ExpireVersions');

View File

@ -253,15 +253,6 @@ class OC_DB {
return $result; 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 * remove all tables defined in a database structure xml file
* @param string $file the xml file describing the tables * @param string $file the xml file describing the tables

View File

@ -40,7 +40,7 @@ class Connection extends \Test\TestCase {
protected static function dropTestTable() protected static function dropTestTable()
{ {
if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') { if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') {
\OC_DB::dropTable('table'); \OC::$server->getDatabaseConnection()->dropTable('table');
} }
} }

View File

@ -24,7 +24,7 @@ class MDB2SchemaManager extends \Test\TestCase {
// do not drop the table for Oracle as it will create a bogus transaction // do not drop the table for Oracle as it will create a bogus transaction
// that will break the following test suites requiring transactions // that will break the following test suites requiring transactions
if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') { if (\OC::$server->getConfig()->getSystemValue('dbtype', 'sqlite') !== 'oci') {
\OC_DB::dropTable('table'); \OC::$server->getDatabaseConnection()->dropTable('table');
} }
parent::tearDown(); parent::tearDown();