aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Webster <noxwizard@phpbb.com>2014-03-02 21:36:50 -0600
committerPatrick Webster <noxwizard@phpbb.com>2014-03-28 17:05:25 -0500
commit31e610f0b1a9f22701660e72d63fe2290298d812 (patch)
tree88091cf380ddb06a034f53db0a7d09d016bddf10
parenta2580687ee8a557d026af75d8d6fcf477e8c435e (diff)
downloadforums-31e610f0b1a9f22701660e72d63fe2290298d812.tar
forums-31e610f0b1a9f22701660e72d63fe2290298d812.tar.gz
forums-31e610f0b1a9f22701660e72d63fe2290298d812.tar.bz2
forums-31e610f0b1a9f22701660e72d63fe2290298d812.tar.xz
forums-31e610f0b1a9f22701660e72d63fe2290298d812.zip
[ticket/9725] Move primary key creation to the correct location
PHPBB3-9725
-rw-r--r--phpBB/includes/db/db_tools.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/phpBB/includes/db/db_tools.php b/phpBB/includes/db/db_tools.php
index 3a7ea2f945..8372f90369 100644
--- a/phpBB/includes/db/db_tools.php
+++ b/phpBB/includes/db/db_tools.php
@@ -468,6 +468,15 @@ class phpbb_db_tools
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
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
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
if (isset($table_data['PRIMARY_KEY']))
{