From 5d69a6e8e096faa99fb838dabd7fe548213b0f26 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 28 Oct 2013 15:34:47 +0200 Subject: Fix #2703 --- system/database/DB_forge.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'system/database/DB_forge.php') 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); -- cgit v1.2.3-24-g4f1b From 96185a3a0edcc27fa0af6df761d6353a2208ea9d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 28 Oct 2013 16:04:02 +0200 Subject: Really fix #2703 --- system/database/DB_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/DB_forge.php') diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php index f156d24eb..92806d305 100644 --- a/system/database/DB_forge.php +++ b/system/database/DB_forge.php @@ -744,7 +744,7 @@ abstract class CI_DB_forge { { if (isset($attributes['AFTER'])) { - $field['after'] = $attributes['after']; + $field['after'] = $attributes['AFTER']; } elseif (isset($attributes['FIRST'])) { -- cgit v1.2.3-24-g4f1b