summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/sqlsrv/sqlsrv_forge.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-06-07 15:22:35 +0200
committerAndrey Andreev <narf@bofh.bg>2012-06-07 15:22:35 +0200
commitaf4d55da04b8d8750b59e04e46463d525237b74b (patch)
tree70a74e4d1e5d4331beb2e87e3415d4f652cb2162 /system/database/drivers/sqlsrv/sqlsrv_forge.php
parent1f26edc61f314a74cd93fcdf688b3780734e0e96 (diff)
Fix issue #861 (and previous commit, for that matter)
Diffstat (limited to 'system/database/drivers/sqlsrv/sqlsrv_forge.php')
-rw-r--r--system/database/drivers/sqlsrv/sqlsrv_forge.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/system/database/drivers/sqlsrv/sqlsrv_forge.php b/system/database/drivers/sqlsrv/sqlsrv_forge.php
index bd107476e..d8b5193fa 100644
--- a/system/database/drivers/sqlsrv/sqlsrv_forge.php
+++ b/system/database/drivers/sqlsrv/sqlsrv_forge.php
@@ -67,11 +67,10 @@ class CI_DB_sqlsrv_forge extends CI_DB_forge {
else
{
$attributes = array_change_key_case($attributes, CASE_UPPER);
- $attributes['TYPE'] = preg_replace('/(INT)\(\d+\)/i', '$1', $attributes['TYPE']);
$sql .= "\n\t".$this->db->escape_identifiers($field).' '.$attributes['TYPE'];
- if (array_key_exists('CONSTRAINT', $attributes))
+ if (stripos($attributes['TYPE'], 'INT') === FALSE && ! empty($attributes['CONSTRAINT']))
{
$sql .= '('.$attributes['CONSTRAINT'].')';
}