]> source.dussan.org Git - nextcloud-server.git/commitdiff
Disable database migrations for MSSQL - scripts have to be applied manually
authorThomas Müller <thomas.mueller@tmit.eu>
Mon, 15 Sep 2014 12:26:00 +0000 (14:26 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Mon, 15 Sep 2014 13:00:32 +0000 (15:00 +0200)
lib/private/db/mdb2schemamanager.php
lib/private/db/mssqlmigrator.php [new file with mode: 0644]

index 91e590a901a954ea7de3b0b61841adf68e40b67c..a07c421b9b816af499c2828d0cd51e0c9402b723 100644 (file)
@@ -12,6 +12,7 @@ use Doctrine\DBAL\Platforms\MySqlPlatform;
 use Doctrine\DBAL\Platforms\OraclePlatform;
 use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
 use Doctrine\DBAL\Platforms\SqlitePlatform;
+use Doctrine\DBAL\Platforms\SQLServerPlatform;
 
 class MDB2SchemaManager {
        /**
@@ -65,6 +66,8 @@ class MDB2SchemaManager {
                        return new OracleMigrator($this->conn);
                } else if ($platform instanceof MySqlPlatform) {
                        return new MySQLMigrator($this->conn);
+               } else if ($platform instanceof SQLServerPlatform) {
+                       return new MsSqlMigrator($this->conn);
                } else if ($platform instanceof PostgreSqlPlatform) {
                        return new Migrator($this->conn);
                } else {
diff --git a/lib/private/db/mssqlmigrator.php b/lib/private/db/mssqlmigrator.php
new file mode 100644 (file)
index 0000000..28d8c6d
--- /dev/null
@@ -0,0 +1,23 @@
+<?php
+/**
+ * Copyright (c) 2014 Thomas Müller <deepdiver@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;
+
+class MsSqlMigrator extends Migrator {
+
+       /**
+        * @param \Doctrine\DBAL\Schema\Schema $targetSchema
+        */
+       public function migrate(Schema $targetSchema) {
+               throw new MigrationException('',
+                       'Database migration is required to continue operations. Please contact support@owncloud.com to get the required sql migration scripts to be applied.');
+       }
+
+}