summaryrefslogtreecommitdiffstats
path: root/system/database/DB_forge.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/DB_forge.php')
-rw-r--r--system/database/DB_forge.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php
index e6a64f3b8..a71fca78f 100644
--- a/system/database/DB_forge.php
+++ b/system/database/DB_forge.php
@@ -99,7 +99,7 @@ class CI_DB_forge {
{
if (is_array($key))
{
- foreach($key as $one)
+ foreach ($key as $one)
{
$this->add_key($one, $primary);
}
@@ -333,6 +333,12 @@ class CI_DB_forge {
foreach ($field as $k => $v)
{
+ // If no name provided, use the current name
+ if ( ! isset($field[$k]['name']))
+ {
+ $field[$k]['name'] = $k;
+ }
+
$this->add_field(array($k => $field[$k]));
if (count($this->fields) == 0)