summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/cubrid/cubrid_forge.php
diff options
context:
space:
mode:
authorEsen Sagynov <kadishmal@gmail.com>2011-08-11 09:41:16 +0200
committerEsen Sagynov <kadishmal@gmail.com>2011-08-11 09:41:16 +0200
commit2ab2b1e3201a1eca2954ca463df744d5cd2e46cd (patch)
tree1b0ee555b8e61b7278273f62a27ca3d316abe06c /system/database/drivers/cubrid/cubrid_forge.php
parentee3e594893d28ca6370d24d2a4406c1897959175 (diff)
Added back /application/* files (removed in previous commit accidently). Corrected formatting/indenting in CUBRID Driver classes. Added myself as the driver author. Applied the MySQL fix, previously accepted in pull request #29, to CUBRID Driver.
Diffstat (limited to 'system/database/drivers/cubrid/cubrid_forge.php')
-rw-r--r--system/database/drivers/cubrid/cubrid_forge.php20
1 files changed, 12 insertions, 8 deletions
diff --git a/system/database/drivers/cubrid/cubrid_forge.php b/system/database/drivers/cubrid/cubrid_forge.php
index 1de0db108..bab03f748 100644
--- a/system/database/drivers/cubrid/cubrid_forge.php
+++ b/system/database/drivers/cubrid/cubrid_forge.php
@@ -1,4 +1,4 @@
-<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
@@ -19,7 +19,7 @@
* CUBRID Forge Class
*
* @category Database
- * @author ExpressionEngine Dev Team
+ * @author Esen Sagynov
* @link http://codeigniter.com/user_guide/database/
*/
class CI_DB_cubrid_forge extends CI_DB_forge {
@@ -81,7 +81,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
{
$attributes = array_change_key_case($attributes, CASE_UPPER);
- $sql .= "\n\t\"".$this->db->_protect_identifiers($field) . "\"";
+ $sql .= "\n\t\"" . $this->db->_protect_identifiers($field) . "\"";
if (array_key_exists('NAME', $attributes))
{
@@ -90,7 +90,7 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
if (array_key_exists('TYPE', $attributes))
{
- $sql .= ' '.$attributes['TYPE'];
+ $sql .= ' '.$attributes['TYPE'];
if (array_key_exists('CONSTRAINT', $attributes))
{
@@ -125,17 +125,21 @@ class CI_DB_cubrid_forge extends CI_DB_forge {
$sql .= ' DEFAULT \''.$attributes['DEFAULT'].'\'';
}
- if (array_key_exists('NULL', $attributes))
+ if (array_key_exists('NULL', $attributes) && $attributes['NULL'] === TRUE)
{
- $sql .= ($attributes['NULL'] === TRUE) ? '' : ' NOT NULL';
+ $sql .= ' NULL';
+ }
+ else
+ {
+ $sql .= ' NOT NULL';
}
if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE)
{
$sql .= ' AUTO_INCREMENT';
}
-
- if (array_key_exists('UNIQUE', $attributes) && $attributes['UNIQUE'] === TRUE)
+
+ if (array_key_exists('UNIQUE', $attributes) && $attributes['UNIQUE'] === TRUE)
{
$sql .= ' UNIQUE';
}