]> source.dussan.org Git - nextcloud-server.git/commitdiff
Skip migration checks for all sql backends besides mysql, postgres and sqlite
authorRobin Appelman <icewind@owncloud.com>
Tue, 6 May 2014 12:04:22 +0000 (14:04 +0200)
committerRobin Appelman <icewind@owncloud.com>
Tue, 3 Jun 2014 09:18:45 +0000 (11:18 +0200)
lib/private/db/mdb2schemamanager.php
lib/private/db/nocheckmigrator.php [new file with mode: 0644]
lib/private/db/oraclemigrator.php

index 1c9b6b9d00bd6c4de560ac07673044371ed231a1..1a19e737da86bae65654fd89e0c519fa30dcbab3 100644 (file)
@@ -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 (file)
index 0000000..cd2b47c
--- /dev/null
@@ -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) {}
+}
index 5494bcbac3056a22848d5dbccec749cb23b6dd1f..de4348bd56dff9709bbd1b9006a46b077dbd2c11 100644 (file)
@@ -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