From 1394304472f1c917b8f6680c57bf50c780744f2d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 17 Mar 2014 11:50:45 +0200 Subject: Fix DB forge unsigned attribute (PR #2949) --- system/database/DB_forge.php | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) (limited to 'system/database') diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index 38e4ccf2c..21ef40119 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -747,25 +747,23 @@ abstract class CI_DB_forge { continue; } - if (isset($attributes['TYPE'])) - { - $this->_attr_type($attributes); - $this->_attr_unsigned($attributes, $field); - } + isset($attributes['TYPE']) && $this->_attr_type($attributes); $field = array( - 'name' => $key, - 'new_name' => isset($attributes['NAME']) ? $attributes['NAME'] : NULL, - 'type' => isset($attributes['TYPE']) ? $attributes['TYPE'] : NULL, - 'length' => '', - 'unsigned' => '', - 'null' => '', - 'unique' => '', - 'default' => '', - 'auto_increment' => '', - '_literal' => FALSE + 'name' => $key, + 'new_name' => isset($attributes['NAME']) ? $attributes['NAME'] : NULL, + 'type' => isset($attributes['TYPE']) ? $attributes['TYPE'] : NULL, + 'length' => '', + 'unsigned' => '', + 'null' => '', + 'unique' => '', + 'default' => '', + 'auto_increment' => '', + '_literal' => FALSE ); + isset($attributes['TYPE']) && $this->_attr_unsigned($attributes, $field); + if ($create_table === FALSE) { if (isset($attributes['AFTER'])) -- cgit v1.2.3-24-g4f1b