aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-04-29 00:03:49 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-04-29 02:10:41 -0400
commite6eb11bb1168236cbaba0263d322170dc2c7bdcd (patch)
tree258991a8edf1c2d5a32b183c08a8e9812ac7e43e /phpBB/includes/db
parent850741ee16d7505069829bed35f90c599ef73369 (diff)
downloadforums-e6eb11bb1168236cbaba0263d322170dc2c7bdcd.tar
forums-e6eb11bb1168236cbaba0263d322170dc2c7bdcd.tar.gz
forums-e6eb11bb1168236cbaba0263d322170dc2c7bdcd.tar.bz2
forums-e6eb11bb1168236cbaba0263d322170dc2c7bdcd.tar.xz
forums-e6eb11bb1168236cbaba0263d322170dc2c7bdcd.zip
[ticket/10003] Ported d7d96223e7bae7cd60b13c6e7896d95838c3633c to db_tools.
PHPBB3-10003
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/db_tools.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index f4b181c6ad..f22ddc2ee8 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -1371,24 +1371,29 @@ class phpbb_db_tools
switch ($this->sql_layer)
{
case 'firebird':
+ // Does not support AFTER statement, only POSITION (and there you need the column position)
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD "' . strtoupper($column_name) . '" ' . $column_data['column_type_sql'];
break;
case 'mssql':
case 'mssqlnative':
+ // Does not support AFTER, only through temporary table
$statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
break;
case 'mysql_40':
case 'mysql_41':
- $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'];
+ $after = (!empty($column_data['after'])) ? ' AFTER ' . $column_data['after'] : '';
+ $statements[] = 'ALTER TABLE `' . $table_name . '` ADD COLUMN `' . $column_name . '` ' . $column_data['column_type_sql'] . $after;
break;
case 'oracle':
+ // Does not support AFTER, only through temporary table
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql'];
break;
case 'postgres':
+ // Does not support AFTER, only through temporary table
if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
{
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
@@ -2120,4 +2125,4 @@ class phpbb_db_tools
}
}
-?> \ No newline at end of file
+?>