summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql
diff options
context:
space:
mode:
authorAdam Jackett <adam@darkhousemedia.com>2011-07-23 15:50:34 +0200
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-08-13 19:23:47 +0200
commitc5961e7d778d5a9361df4cfbc7da5fc4370d883f (patch)
tree38b4b3e2eea38eeb88a6b9f1860db3d5e2698a86 /system/database/drivers/mysql
parent32ad584b25b6429b2e4ce2f38177e88a12f2b117 (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/mysql')
-rw-r--r--system/database/drivers/mysql/mysql_forge.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/system/database/drivers/mysql/mysql_forge.php b/system/database/drivers/mysql/mysql_forge.php
index 529ec980d..c1cae136c 100644
--- a/system/database/drivers/mysql/mysql_forge.php
+++ b/system/database/drivers/mysql/mysql_forge.php
@@ -119,9 +119,13 @@ class CI_DB_mysql_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)