summaryrefslogtreecommitdiffstats
path: root/system/database/DB_forge.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-10-31 14:10:56 +0100
committerAndrey Andreev <narf@devilix.net>2013-10-31 14:10:56 +0100
commitd6feb5abb9333fb430a773f20f24e178f6c486da (patch)
tree15142faeeda3bc1e66cc6de9c33c125510624f57 /system/database/DB_forge.php
parent3c3bbacbf474c687393152c6a49d6d95f2239ca1 (diff)
parent5e3d48c21dea8a97dcea1b820ebc14700a336312 (diff)
Merge branch 'develop' into feature/minify
Diffstat (limited to 'system/database/DB_forge.php')
-rw-r--r--system/database/DB_forge.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php
index d52029ecd..92806d305 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);