Permalink
Browse files

Fixed creation of non-primary composite keys.

Modified CI_DB_forge::add_key() to only recursively add each key in an passed array of keys if they're meant to be primary keys.

Otherwise, the array needs to be maintained so that composite keys are preserved.
  • Loading branch information...
1 parent cca7427 commit 75f405b64ec0dff23bcaf73c9bc805b3804f2863 @AgentConundrum AgentConundrum committed Oct 28, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 system/database/DB_forge.php
View
2 system/database/DB_forge.php
@@ -132,7 +132,7 @@ public function drop_database($db_name)
*/
public function add_key($key = '', $primary = FALSE)
{
- if (is_array($key))
+ if (is_array($key) && $primary === TRUE)
{
foreach ($key as $one)
{

0 comments on commit 75f405b

Please sign in to comment.