summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlsrv/sqlsrv_forge.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-01-26 13:49:23 +0100
committerAndrey Andreev <narf@bofh.bg>2012-01-26 13:49:23 +0100
commit993f932cb27f68ac4a3272502a823af0835b291c (patch)
treebe5b799a66231d6df4a4c8981092997284f3ec1a /system/database/drivers/sqlsrv/sqlsrv_forge.php
parent684ee3a330c90744b249b48212d85dfe4d3b1caf (diff)
Another minor improvement and fix a possible false-positive
Diffstat (limited to 'system/database/drivers/sqlsrv/sqlsrv_forge.php')
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_forge.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php
index c0271f671..3beb86b4e 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_forge.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php
@@ -110,11 +110,11 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge {
$sql .= "\n\t".$this->db->protect_identifiers($field)
.' '.$attributes['TYPE']
- .(isset($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
- .((isset($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
+ .( ! empty($attributes['CONSTRAINT']) ? '('.$attributes['CONSTRAINT'].')' : '')
+ .(( ! empty($attributes['UNSIGNED']) && $attributes['UNSIGNED'] === TRUE) ? ' UNSIGNED' : '')
.(isset($attributes['DEFAULT']) ? ' DEFAULT \''.$attributes['DEFAULT'].'\'' : '')
- .((isset($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
- .((isset($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
+ .(( ! empty($attributes['NULL']) && $attributes['NULL'] === TRUE) ? ' NULL' : ' NOT NULL')
+ .(( ! empty($attributes['AUTO_INCREMENT']) && $attributes['AUTO_INCREMENT'] === TRUE) ? ' AUTO_INCREMENT' : '');
}
// don't add a comma on the end of the last field