aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-05-12 13:54:20 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2014-05-30 23:34:42 +0200
commit999f6216dcfea2d5344c2ceda744461e18d32241 (patch)
treef99dbdfcb889f8c3c870b6a4bf1e656f0874806b /lib/private/db
parentda6aae28ad0cb1bad3d0693f126a5436af64240d (diff)
downloadnextcloud-server-999f6216dcfea2d5344c2ceda744461e18d32241.tar.gz
nextcloud-server-999f6216dcfea2d5344c2ceda744461e18d32241.zip
- fix dropTable() and introduce tableExists()
- kill replaceDB() - this function is unused and it's implementation obviously wrong - add method annotation OC_DB_StatementWrapper::fetchAll - remove duplicate code in Test_DBSchema and reuse OC_DB::tableExists - remove unused variables
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/mdb2schemamanager.php34
-rw-r--r--lib/private/db/statementwrapper.php1
2 files changed, 1 insertions, 34 deletions
diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php
index 1e90c8bda5c..4208dbd18f4 100644
--- a/lib/private/db/mdb2schemamanager.php
+++ b/lib/private/db/mdb2schemamanager.php
@@ -95,19 +95,6 @@ class MDB2SchemaManager {
}
/**
- * drop a table
- * @param string $tableName the table to drop
- */
- public function dropTable($tableName) {
- $sm = $this->conn->getSchemaManager();
- $fromSchema = $sm->createSchema();
- $toSchema = clone $fromSchema;
- $toSchema->dropTable($tableName);
- $sql = $fromSchema->getMigrateToSql($toSchema, $this->conn->getDatabasePlatform());
- $this->conn->executeQuery($sql);
- }
-
- /**
* remove all tables defined in a database structure xml file
* @param string $file the xml file describing the tables
*/
@@ -125,27 +112,6 @@ class MDB2SchemaManager {
}
/**
- * replaces the ownCloud tables with a new set
- * @param string $file path to the MDB2 xml db export file
- */
- public function replaceDB( $file ) {
- $apps = \OC_App::getAllApps();
- $this->conn->beginTransaction();
- // Delete the old tables
- $this->removeDBStructure( \OC::$SERVERROOT . '/db_structure.xml' );
-
- foreach($apps as $app) {
- $path = \OC_App::getAppPath($app).'/appinfo/database.xml';
- if(file_exists($path)) {
- $this->removeDBStructure( $path );
- }
- }
-
- // Create new tables
- $this->conn->commit();
- }
-
- /**
* @param \Doctrine\DBAL\Schema\Schema $schema
* @return bool
*/
diff --git a/lib/private/db/statementwrapper.php b/lib/private/db/statementwrapper.php
index 70d1f985a41..93fabc147ca 100644
--- a/lib/private/db/statementwrapper.php
+++ b/lib/private/db/statementwrapper.php
@@ -13,6 +13,7 @@
* @method string errorCode();
* @method array errorInfo();
* @method integer rowCount();
+ * @method array fetchAll(integer $fetchMode = null);
*/
class OC_DB_StatementWrapper {
/**