summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/pdo/subdrivers
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-11-03 21:22:57 +0100
committerAndrey Andreev <narf@devilix.net>2014-11-03 21:22:57 +0100
commit288e95dbdcd1c4e4144861919090075b4661f330 (patch)
tree54eaadc4d4f1a99a2b2990c89a63828f6a221563 /system/database/drivers/pdo/subdrivers
parent72b4be8310dc5b05169501bd9851fedf559003a5 (diff)
parentce8aa3b5abe0b20da7dbee70fb49f440ad41b15c (diff)
Merge pull request #3305 from zachflower/feature/mysql-comments
Add COMMENT support to MySQL Forge Drivers
Diffstat (limited to 'system/database/drivers/pdo/subdrivers')
-rw-r--r--system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php
index 6cdfcabb5..2e988c3f5 100644
--- a/system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php
+++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_forge.php
@@ -199,6 +199,8 @@ class CI_DB_pdo_mysql_forge extends CI_DB_pdo_forge {
$extra_clause = ' FIRST';
}
+ $comment_clause = isset($field['comment']) ? ' COMMENT ' . $field['comment'] : '';
+
return $this->db->escape_identifiers($field['name'])
.(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name']))
.' '.$field['type'].$field['length']
@@ -207,6 +209,7 @@ class CI_DB_pdo_mysql_forge extends CI_DB_pdo_forge {
.$field['default']
.$field['auto_increment']
.$field['unique']
+ .$comment_clause
.$extra_clause;
}