summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/postgre/postgre_forge.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-11-03 21:45:28 +0100
committerAndrey Andreev <narf@devilix.net>2014-11-03 21:45:28 +0100
commit5289f27c07bfb1d961317de351c4819f25dd5f2e (patch)
treeda7f7e1a9df24b917e5447d443da5cd9cef1443a /system/database/drivers/postgre/postgre_forge.php
parent288e95dbdcd1c4e4144861919090075b4661f330 (diff)
Polish changes following #3305
Also add support for field comments in PostgreSQL & Oracle ... only via alter_table() for now :/
Diffstat (limited to 'system/database/drivers/postgre/postgre_forge.php')
-rw-r--r--system/database/drivers/postgre/postgre_forge.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/system/database/drivers/postgre/postgre_forge.php b/system/database/drivers/postgre/postgre_forge.php
index 1dcd02761..874c205ba 100644
--- a/system/database/drivers/postgre/postgre_forge.php
+++ b/system/database/drivers/postgre/postgre_forge.php
@@ -70,7 +70,7 @@ class CI_DB_postgre_forge extends CI_DB_forge {
*
* @var string
*/
- protected $_null = 'NULL';
+ protected $_null = 'NULL';
// --------------------------------------------------------------------
@@ -139,6 +139,13 @@ class CI_DB_postgre_forge extends CI_DB_forge {
$sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
.' TO '.$this->db->escape_identifiers($field[$i]['new_name']);
}
+
+ if ( ! empty($field[$i]['comment']))
+ {
+ $sqls[] = 'COMMENT ON COLUMN '
+ .$this->db->escape_identifiers($table).'.'.$this->db->escape_identifiers($field[$i]['name'])
+ .' IS '.$field[$i]['comment'];
+ }
}
return $sqls;
@@ -190,8 +197,8 @@ class CI_DB_postgre_forge extends CI_DB_forge {
if ( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE)
{
$field['type'] = ($field['type'] === 'NUMERIC')
- ? 'BIGSERIAL'
- : 'SERIAL';
+ ? 'BIGSERIAL'
+ : 'SERIAL';
}
}