summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/oci8')
-rw-r--r--system/database/drivers/oci8/oci8_forge.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/system/database/drivers/oci8/oci8_forge.php b/system/database/drivers/oci8/oci8_forge.php
index 9f3fac54f..6266c75a3 100644
--- a/system/database/drivers/oci8/oci8_forge.php
+++ b/system/database/drivers/oci8/oci8_forge.php
@@ -135,10 +135,21 @@ class CI_DB_oci8_forge extends CI_DB_forge {
$sql .= ",\n\tPRIMARY KEY (" . implode(', ', $primary_keys) . ")";
}
- if (count($keys) > 0)
+ if (is_array($keys) && count($keys) > 0)
{
- $keys = $this->db->_protect_identifiers($keys);
- $sql .= ",\n\tUNIQUE COLUMNS (" . implode(', ', $keys) . ")";
+ foreach ($keys as $key)
+ {
+ if (is_array($key))
+ {
+ $key = $this->db->_protect_identifiers($key);
+ }
+ else
+ {
+ $key = array($this->db->_protect_identifiers($key));
+ }
+
+ $sql .= ",\n\tUNIQUE COLUMNS (" . implode(', ', $key) . ")";
+ }
}
$sql .= "\n)";