diff options
author | Andrey Andreev <narf@devilix.net> | 2013-10-28 14:34:47 +0100 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2013-10-28 14:34:47 +0100 |
commit | 5d69a6e8e096faa99fb838dabd7fe548213b0f26 (patch) | |
tree | 62cf916e422a2b7a21977b0c74f1f9b2688c6e6d /system | |
parent | 710c4ed57e916714b04bec079b03cb47621ec393 (diff) |
Fix #2703
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB_forge.php | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index d52029ecd..f156d24eb 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -740,6 +740,18 @@ abstract class CI_DB_forge { '_literal' => FALSE ); + if ($create_table === FALSE) + { + if (isset($attributes['AFTER'])) + { + $field['after'] = $attributes['after']; + } + elseif (isset($attributes['FIRST'])) + { + $field['first'] = (bool) $attributes['FIRST']; + } + } + $this->_attr_default($attributes, $field); if (isset($attributes['NULL'])) @@ -748,11 +760,15 @@ abstract class CI_DB_forge { { $field['null'] = empty($this->_null) ? '' : ' '.$this->_null; } - elseif ($create_table === TRUE) + else { $field['null'] = ' NOT NULL'; } } + elseif ($create_table === TRUE) + { + $field['null'] = ' NOT NULL'; + } $this->_attr_auto_increment($attributes, $field); $this->_attr_unique($attributes, $field); |