Skip to content

Commit 5d69a6e

Browse files
committed
1 parent 710c4ed commit 5d69a6e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

system/database/DB_forge.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,6 +740,18 @@ protected function _process_fields($create_table = FALSE)
740740
'_literal' => FALSE
741741
);
742742

743+
if ($create_table === FALSE)
744+
{
745+
if (isset($attributes['AFTER']))
746+
{
747+
$field['after'] = $attributes['after'];
748+
}
749+
elseif (isset($attributes['FIRST']))
750+
{
751+
$field['first'] = (bool) $attributes['FIRST'];
752+
}
753+
}
754+
743755
$this->_attr_default($attributes, $field);
744756

745757
if (isset($attributes['NULL']))
@@ -748,11 +760,15 @@ protected function _process_fields($create_table = FALSE)
748760
{
749761
$field['null'] = empty($this->_null) ? '' : ' '.$this->_null;
750762
}
751-
elseif ($create_table === TRUE)
763+
else
752764
{
753765
$field['null'] = ' NOT NULL';
754766
}
755767
}
768+
elseif ($create_table === TRUE)
769+
{
770+
$field['null'] = ' NOT NULL';
771+
}
756772

757773
$this->_attr_auto_increment($attributes, $field);
758774
$this->_attr_unique($attributes, $field);

0 commit comments

Comments
 (0)