summaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-05-06 14:04:22 +0200
committerRobin Appelman <icewind@owncloud.com>2014-06-03 11:18:45 +0200
commit6f71419f2b0e8e671274ca761e636ebe0a4067b3 (patch)
tree03e3748bb0f8324aee1a0923665189174fae8ea1 /lib/private/db
parenta59f6818ebeffa23ad1b66652179f3592bd4931d (diff)
downloadnextcloud-server-6f71419f2b0e8e671274ca761e636ebe0a4067b3.tar.gz
nextcloud-server-6f71419f2b0e8e671274ca761e636ebe0a4067b3.zip
Skip migration checks for all sql backends besides mysql, postgres and sqlite
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/mdb2schemamanager.php6
-rw-r--r--lib/private/db/nocheckmigrator.php24
-rw-r--r--lib/private/db/oraclemigrator.php10
3 files changed, 30 insertions, 10 deletions
diff --git a/lib/private/db/mdb2schemamanager.php b/lib/private/db/mdb2schemamanager.php
index 1c9b6b9d00b..1a19e737da8 100644
--- a/lib/private/db/mdb2schemamanager.php
+++ b/lib/private/db/mdb2schemamanager.php
@@ -8,7 +8,9 @@
namespace OC\DB;
+use Doctrine\DBAL\Platforms\MySqlPlatform;
use Doctrine\DBAL\Platforms\OraclePlatform;
+use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
use Doctrine\DBAL\Platforms\SqlitePlatform;
class MDB2SchemaManager {
@@ -62,8 +64,10 @@ class MDB2SchemaManager {
return new SQLiteMigrator($this->conn);
} else if ($platform instanceof OraclePlatform) {
return new OracleMigrator($this->conn);
- } else {
+ } else if ($platform instanceof MySqlPlatform or $platform instanceof PostgreSqlPlatform) {
return new Migrator($this->conn);
+ } else {
+ return new NoCheckMigrator($this->conn);
}
}
diff --git a/lib/private/db/nocheckmigrator.php b/lib/private/db/nocheckmigrator.php
new file mode 100644
index 00000000000..cd2b47c214a
--- /dev/null
+++ b/lib/private/db/nocheckmigrator.php
@@ -0,0 +1,24 @@
+<?php
+/**
+ * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
+ * This file is licensed under the Affero General Public License version 3 or
+ * later.
+ * See the COPYING-README file.
+ */
+
+namespace OC\DB;
+
+use Doctrine\DBAL\Schema\Schema;
+
+/**
+ * migrator for database platforms that don't support the upgrade check
+ *
+ * @package OC\DB
+ */
+class NoCheckMigrator extends Migrator {
+ /**
+ * @param \Doctrine\DBAL\Schema\Schema $targetSchema
+ * @throws \OC\DB\MigrationException
+ */
+ public function checkMigrate(Schema $targetSchema) {}
+}
diff --git a/lib/private/db/oraclemigrator.php b/lib/private/db/oraclemigrator.php
index 5494bcbac30..de4348bd56d 100644
--- a/lib/private/db/oraclemigrator.php
+++ b/lib/private/db/oraclemigrator.php
@@ -10,15 +10,7 @@ namespace OC\DB;
use Doctrine\DBAL\Schema\Schema;
-class OracleMigrator extends Migrator {
- /**
- * @param \Doctrine\DBAL\Schema\Schema $targetSchema
- * @throws \OC\DB\MigrationException
- *
- * Migration testing is skipped for oracle
- */
- public function checkMigrate(Schema $targetSchema) {}
-
+class OracleMigrator extends NoCheckMigrator {
/**
* @param Schema $targetSchema
* @param \Doctrine\DBAL\Connection $connection