mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
[ticket/9725] Move primary key creation to the correct location
PHPBB3-9725
This commit is contained in:
@@ -468,6 +468,15 @@ class phpbb_db_tools
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
|
||||||
|
{
|
||||||
|
if (!isset($table_data['PRIMARY_KEY']))
|
||||||
|
{
|
||||||
|
$table_data['COLUMNS']['mssqlindex'] = array('UINT', NULL, 'auto_increment');
|
||||||
|
$table_data['PRIMARY_KEY'] = 'mssqlindex';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Iterate through the columns to create a table
|
// Iterate through the columns to create a table
|
||||||
foreach ($table_data['COLUMNS'] as $column_name => $column_data)
|
foreach ($table_data['COLUMNS'] as $column_name => $column_data)
|
||||||
{
|
{
|
||||||
@@ -523,15 +532,6 @@ class phpbb_db_tools
|
|||||||
// this means that we can add the one we really wanted instead
|
// this means that we can add the one we really wanted instead
|
||||||
if (!$primary_key_gen)
|
if (!$primary_key_gen)
|
||||||
{
|
{
|
||||||
if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
|
|
||||||
{
|
|
||||||
if (!isset($table_data['PRIMARY_KEY']))
|
|
||||||
{
|
|
||||||
$table_data['COLUMNS']['mssqlindex'] = array('UINT', NULL, 'auto_increment');
|
|
||||||
$table_data['PRIMARY_KEY'] = 'mssqlindex';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Write primary key
|
// Write primary key
|
||||||
if (isset($table_data['PRIMARY_KEY']))
|
if (isset($table_data['PRIMARY_KEY']))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user