summaryrefslogtreecommitdiffstats
path: root/lib/private/db
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-12-09 17:26:39 +0100
committerRobin Appelman <icewind@owncloud.com>2014-12-09 17:26:53 +0100
commit6984fa8a19f09fe8e3c9ac8c48225dd40b1cc94c (patch)
treead23306afc7f6150ee30121ad44acf206a0a8cad /lib/private/db
parentb66c0a1631eeea2ac252880ed65e277120fa6655 (diff)
downloadnextcloud-server-6984fa8a19f09fe8e3c9ac8c48225dd40b1cc94c.tar.gz
nextcloud-server-6984fa8a19f09fe8e3c9ac8c48225dd40b1cc94c.zip
Quote identifiers for oracle
Diffstat (limited to 'lib/private/db')
-rw-r--r--lib/private/db/oracleconnection.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/lib/private/db/oracleconnection.php b/lib/private/db/oracleconnection.php
index 4cec7bc4ae4..726ac1e4b6d 100644
--- a/lib/private/db/oracleconnection.php
+++ b/lib/private/db/oracleconnection.php
@@ -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));
+ }
}