summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/oci8
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2008-05-29 19:52:11 +0200
committerDerek Jones <derek.jones@ellislab.com>2008-05-29 19:52:11 +0200
commitbd4400988922b2560975a80498404d7ecd000c0b (patch)
tree2c8630cd43f1a16700c53363578191de342fb3d4 /system/database/drivers/oci8
parent9e11220c2b780ca3320deae7e91a272b84c88533 (diff)
made MySQL/MySQLi forge use explicitly named KEYs, added ability to specify multi-column non-primary keys in table creation
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)";