aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-11-19 13:33:29 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-11-19 13:33:29 +0000
commita4d0eba7814d633ee3b4a7f0d9bc47854c5845a5 (patch)
tree22554208ee9d97ec5c5efdc0bc89d4d492684e2a /phpBB/includes/db
parent271e819d003ee92bba70d3a4532afbba15acf895 (diff)
downloadforums-a4d0eba7814d633ee3b4a7f0d9bc47854c5845a5.tar
forums-a4d0eba7814d633ee3b4a7f0d9bc47854c5845a5.tar.gz
forums-a4d0eba7814d633ee3b4a7f0d9bc47854c5845a5.tar.bz2
forums-a4d0eba7814d633ee3b4a7f0d9bc47854c5845a5.tar.xz
forums-a4d0eba7814d633ee3b4a7f0d9bc47854c5845a5.zip
hopefully fixing bug #14890 - need to test later
git-svn-id: file:///svn/phpbb/trunk@8247 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/db_tools.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index ee8825f136..0a65fc12ca 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -709,22 +709,26 @@ class phpbb_db_tools
case 'mssql':
$sql .= " {$column_type} ";
+ $sql_default = " {$column_type} ";
- // we do not support MSSQL DEFAULTs for the near future
- /*if (!is_null($column_data[1]))
+ // For adding columns we need the default definition
+ if (!is_null($column_data[1]))
{
// For hexadecimal values do not use single quotes
if (strpos($column_data[1], '0x') === 0)
{
- $sql .= 'DEFAULT (' . $column_data[1] . ') ';
+ $sql_default .= 'DEFAULT (' . $column_data[1] . ') ';
}
else
{
- $sql .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
+ $sql_default .= 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
}
- }*/
+ }
$sql .= 'NOT NULL';
+ $sql_default .= 'NOT NULL';
+
+ $return_array['column_type_sql_default'] = $sql_default;
break;
case 'mysql_40':
@@ -828,7 +832,7 @@ class phpbb_db_tools
break;
case 'mssql':
- $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql'];
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
break;
case 'mysql_40':