summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mssql
diff options
context:
space:
mode:
Diffstat (limited to 'system/database/drivers/mssql')
-rw-r--r--system/database/drivers/mssql/mssql_forge.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/system/database/drivers/mssql/mssql_forge.php b/system/database/drivers/mssql/mssql_forge.php
index 5454e37b3..e6227e189 100644
--- a/system/database/drivers/mssql/mssql_forge.php
+++ b/system/database/drivers/mssql/mssql_forge.php
@@ -67,11 +67,10 @@ class CI_DB_mssql_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'].')';
}