]> source.dussan.org Git - nextcloud-server.git/commitdiff
Rename platform
authorRobin Appelman <icewind@owncloud.com>
Wed, 4 Mar 2015 14:05:30 +0000 (15:05 +0100)
committerVincent Petry <pvince81@owncloud.com>
Wed, 25 Mar 2015 17:33:21 +0000 (18:33 +0100)
lib/private/db/connectionfactory.php
lib/private/db/ocsqliteplatform.php [new file with mode: 0644]
lib/private/db/sqliteplatform.php [deleted file]

index c488bf82d1f9b8915ef29660fcf0bcc198f13130..b86e7319ae7f1a146854b9b970c7eebfa08c1f27 100644 (file)
@@ -96,7 +96,7 @@ class ConnectionFactory {
                                break;
                        case 'sqlite3':
                                $journalMode = $additionalConnectionParams['sqlite.journal_mode'];
-                               $additionalConnectionParams['platform'] = new SqlitePlatform();
+                               $additionalConnectionParams['platform'] = new OCSqlitePlatform();
                                $eventManager->addEventSubscriber(new SQLiteSessionInit(true, $journalMode));
                                break;
                }
diff --git a/lib/private/db/ocsqliteplatform.php b/lib/private/db/ocsqliteplatform.php
new file mode 100644 (file)
index 0000000..fe39e20
--- /dev/null
@@ -0,0 +1,35 @@
+<?php
+/**
+ * Copyright (c) 2015 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;
+
+class OCSqlitePlatform extends \Doctrine\DBAL\Platforms\SqlitePlatform {
+       /**
+        * {@inheritDoc}
+        */
+       public function getColumnDeclarationSQL($name, array $field) {
+               $def = parent::getColumnDeclarationSQL($name, $field);
+               if (!empty($field['autoincrement'])) {
+                       $def .= ' PRIMARY KEY AUTOINCREMENT';
+               }
+               return $def;
+       }
+
+       /**
+        * {@inheritDoc}
+        */
+       protected function _getCreateTableSQL($name, array $columns, array $options = array()){
+               // if auto increment is set the column is already defined as primary key
+               foreach ($columns as $column) {
+                       if (!empty($column['autoincrement'])) {
+                               $options['primary'] = null;
+                       }
+               }
+               return parent::_getCreateTableSQL($name, $columns, $options);
+       }
+}
diff --git a/lib/private/db/sqliteplatform.php b/lib/private/db/sqliteplatform.php
deleted file mode 100644 (file)
index b2eec7d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * Copyright (c) 2015 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;
-
-class SqlitePlatform extends \Doctrine\DBAL\Platforms\SqlitePlatform {
-       /**
-        * {@inheritDoc}
-        */
-       public function getColumnDeclarationSQL($name, array $field) {
-               $def = parent::getColumnDeclarationSQL($name, $field);
-               if (!empty($field['autoincrement'])) {
-                       $def .= ' PRIMARY KEY AUTOINCREMENT';
-               }
-               return $def;
-       }
-
-       /**
-        * {@inheritDoc}
-        */
-       protected function _getCreateTableSQL($name, array $columns, array $options = array()){
-               // if auto increment is set the column is already defined as primary key
-               foreach ($columns as $column) {
-                       if (!empty($column['autoincrement'])) {
-                               $options['primary'] = null;
-                       }
-               }
-               return parent::_getCreateTableSQL($name, $columns, $options);
-       }
-}