mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 20:13:22 +01:00
[ticket/10003] Ported d7d96223e7bae7cd60b13c6e7896d95838c3633c to db_tools.
PHPBB3-10003
This commit is contained in:
parent
850741ee16
commit
e6eb11bb11
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user