summaryrefslogtreecommitdiffstats
path: root/system/database/DB_forge.php
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/DB_forge.php')
-rw-r--r--system/database/DB_forge.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php
index 7c9c03e24..21046012a 100644
--- a/system/database/DB_forge.php
+++ b/system/database/DB_forge.php
@@ -532,11 +532,13 @@ abstract class CI_DB_forge {
/**
* Column Add
*
+ * @todo Remove deprecated $_after option in 3.1+
* @param string $table Table name
* @param array $field Column definition
+ * @param string $_after Column for AFTER clause (deprecated)
* @return bool
*/
- public function add_column($table = '', $field = array())
+ public function add_column($table = '', $field = array(), $_after = NULL)
{
if ($table === '')
{
@@ -551,6 +553,12 @@ abstract class CI_DB_forge {
foreach (array_keys($field) as $k)
{
+ // Backwards-compatibility work-around for MySQL/CUBRID AFTER clause (remove in 3.1+)
+ if ($_after !== NULL && is_array($field[$k]) && ! isset($field[$k]['after']))
+ {
+ $field[$k]['after'] = $_after;
+ }
+
$this->add_field(array($k => $field[$k]));
}