summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysqli
diff options
context:
space:
mode:
authorAdam Jackett <adam@darkhousemedia.com>2011-07-23 15:50:34 +0200
committerAdam Jackett <adam@darkhousemedia.com>2011-07-23 15:50:34 +0200
commit242c258f2bf027e7c13b448131bd7e94bde81027 (patch)
tree5fa887893cb30d0c1a02bc62744bac0b71d0615c /system/database/drivers/mysqli
parent8731f641de823fcdcb8b2a2fa6034fca8fe4a164 (diff)
Fixed mysql and mysqli drivers to set NOT NULL as default for creating fields. All other drivers were correct.
Diffstat (limited to 'system/database/drivers/mysqli')
-rw-r--r--system/database/drivers/mysqli/mysqli_forge.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/system/database/drivers/mysqli/mysqli_forge.php b/system/database/drivers/mysqli/mysqli_forge.php
index d5097335e..260549457 100644
--- a/system/database/drivers/mysqli/mysqli_forge.php
+++ b/system/database/drivers/mysqli/mysqli_forge.php
@@ -104,9 +104,13 @@ class CI_DB_mysqli_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) ? ' NULL' : ' NOT NULL';
+ $sql .= ' NULL';
+ }
+ else
+ {
+ $sql .= ' NOT NULL';
}
if (array_key_exists('AUTO_INCREMENT', $attributes) && $attributes['AUTO_INCREMENT'] === TRUE)