diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-11-22 12:12:22 +0100 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-11-22 12:12:22 +0100 |
commit | 7ade8b7944d10f4fd1583789309cf003a3eac6f7 (patch) | |
tree | b5b305d5d8ffb781682914a40f19ae8aa9dac477 /system/database/drivers/cubrid | |
parent | 2eaeee5aa3971932e58ffac48554e554d799249f (diff) |
Fix modify_column() issues (#2020)
Diffstat (limited to 'system/database/drivers/cubrid')
-rw-r--r-- | system/database/drivers/cubrid/cubrid_forge.php | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php index 05762ba5a..9a7cdb805 100644 --- a/system/database/drivers/cubrid/cubrid_forge.php +++ b/system/database/drivers/cubrid/cubrid_forge.php @@ -108,12 +108,8 @@ class CI_DB_cubrid_forge extends CI_DB_forge { } else { - $sqls[] = $sql.' CHANGE '.$this->_process_column($field[$i]); - if ( ! empty($field[$i]['new_name'])) - { - $sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name']) - .' AS '.$this->db->escape_identifiers($field[$i]['name']); - } + $alter_type = empty($field[$i]['new_name']) ? ' MODIFY ' : ' CHANGE '; + $sqls[] = $sql.$alter_type$this->_process_column($field[$i]); } } @@ -139,7 +135,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge { } return $this->db->escape_identifiers($field['name']) - .(empty($field['new_name']) ? '' : $this->db->escape_identifiers($field['new_name'])) + .(empty($field['new_name']) ? '' : ' '.$this->db->escape_identifiers($field['new_name'])) .' '.$field['type'].$field['length'] .$field['unsigned'] .$field['null'] |