From bd4400988922b2560975a80498404d7ecd000c0b Mon Sep 17 00:00:00 2001 From: Derek Jones Date: Thu, 29 May 2008 17:52:11 +0000 Subject: made MySQL/MySQLi forge use explicitly named KEYs, added ability to specify multi-column non-primary keys in table creation --- system/database/drivers/oci8/oci8_forge.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'system/database/drivers/oci8') 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)"; -- cgit v1.2.3-24-g4f1b