From 24fbc61e4a46c1e9f185c36629960dce0bad71e2 Mon Sep 17 00:00:00 2001 From: Zachary Flower Date: Sun, 2 Nov 2014 21:50:15 -0700 Subject: Add support for the COMMENT field in DBForge and MySQL Forge classes (pdo, mysql, and mysqli) Signed-off-by: Zachary Flower --- system/database/drivers/mysqli/mysqli_forge.php | 1 + 1 file changed, 1 insertion(+) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index c9a5b6db7..c92d22264 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -194,6 +194,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['null'] .$field['default'] .$field['auto_increment'] + .$field['comment'] .$field['unique'] .$extra_clause; } -- cgit v1.2.3-24-g4f1b From 12ee7a1a74e45b1369876ea945ae3347da046087 Mon Sep 17 00:00:00 2001 From: Zachary Flower Date: Mon, 3 Nov 2014 08:38:41 -0700 Subject: Move comment field after unique field in db forge --- system/database/drivers/mysqli/mysqli_forge.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index c92d22264..e37bd1b80 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -194,8 +194,8 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['null'] .$field['default'] .$field['auto_increment'] - .$field['comment'] .$field['unique'] + .$field['comment'] .$extra_clause; } -- cgit v1.2.3-24-g4f1b From e4b10bf0ad59049ed78ed9cfc5f708188f3cd442 Mon Sep 17 00:00:00 2001 From: Zachary Flower Date: Mon, 3 Nov 2014 10:42:57 -0700 Subject: Move MySQL comments to MySQL forge classes only --- system/database/drivers/mysqli/mysqli_forge.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'system/database/drivers/mysqli/mysqli_forge.php') diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php index e37bd1b80..38f624909 100644 --- a/system/database/drivers/mysqli/mysqli_forge.php +++ b/system/database/drivers/mysqli/mysqli_forge.php @@ -187,6 +187,8 @@ class CI_DB_mysqli_forge extends CI_DB_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'] @@ -195,7 +197,7 @@ class CI_DB_mysqli_forge extends CI_DB_forge { .$field['default'] .$field['auto_increment'] .$field['unique'] - .$field['comment'] + .$comment_clause .$extra_clause; } -- cgit v1.2.3-24-g4f1b