]> source.dussan.org Git - nextcloud-server.git/commitdiff
Quote identifiers for oracle
authorRobin Appelman <icewind@owncloud.com>
Tue, 9 Dec 2014 16:26:39 +0000 (17:26 +0100)
committerRobin Appelman <icewind@owncloud.com>
Tue, 9 Dec 2014 16:26:53 +0000 (17:26 +0100)
lib/private/db/oracleconnection.php

index 4cec7bc4ae43bb7370101812c3aaad84b1eba5c2..726ac1e4b6d9091fa5dbb1f357c910b464bf3a9a 100644 (file)
@@ -47,4 +47,31 @@ class OracleConnection extends Connection {
                $identifier = $this->quoteKeys($identifier);
                return parent::delete($tableName, $identifier);
        }
+
+       /**
+        * Drop a table from the database if it exists
+        *
+        * @param string $table table name without the prefix
+        */
+       public function dropTable($table) {
+               $table = $this->tablePrefix . trim($table);
+               $table = $this->quoteIdentifier($table);
+               $schema = $this->getSchemaManager();
+               if($schema->tablesExist(array($table))) {
+                       $schema->dropTable($table);
+               }
+       }
+
+       /**
+        * Check if a table exists
+        *
+        * @param string $table table name without the prefix
+        * @return bool
+        */
+       public function tableExists($table){
+               $table = $this->tablePrefix . trim($table);
+               $table = $this->quoteIdentifier($table);
+               $schema = $this->getSchemaManager();
+               return $schema->tablesExist(array($table));
+       }
 }