aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/develop
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-03-29 10:43:09 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-03-29 10:43:09 +0100
commit4e8aef7cd6036b893ee74928b047aaad4a8a84ad (patch)
tree9c1d50d95fb53040db9b78f5e04749ee4b3dbb2f /phpBB/develop
parent40ed3f677699f2d9801bb75168e84766c35722f4 (diff)
parent79492d41109eba2932c020bb5c9a90f19aac2321 (diff)
downloadforums-4e8aef7cd6036b893ee74928b047aaad4a8a84ad.tar
forums-4e8aef7cd6036b893ee74928b047aaad4a8a84ad.tar.gz
forums-4e8aef7cd6036b893ee74928b047aaad4a8a84ad.tar.bz2
forums-4e8aef7cd6036b893ee74928b047aaad4a8a84ad.tar.xz
forums-4e8aef7cd6036b893ee74928b047aaad4a8a84ad.zip
Merge remote-tracking branch 'noxwizard/ticket/naderman/9725' into develop-olympus
* noxwizard/ticket/naderman/9725: [ticket/9725] Code sniffer fixes [ticket/9725] Do not use deprecated views to remove default constraints [ticket/9725] Move primary key creation to the correct location [ticket/9725] Remove trailing spaces from MSSQL schema [ticket/9725] Create MSSQL primary keys if none exist [ticket/9725] Remove explicit filegroup designations [ticket/9725] Fetch Azure db stats from proper table [ticket/9725] Add dummy indexes for Azure [ticket/9725] Create an Azure SQL compatible Schema
Diffstat (limited to 'phpBB/develop')
-rw-r--r--phpBB/develop/create_schema_files.php19
1 files changed, 16 insertions, 3 deletions
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 7b1fff40fb..b5f1202c0d 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -237,6 +237,19 @@ $supported_dbms = array('firebird', 'mssql', 'mysql_40', 'mysql_41', 'oracle', '
foreach ($supported_dbms as $dbms)
{
+ $schema_data = get_schema_struct();
+ if ($dbms == 'mssql')
+ {
+ foreach ($schema_data as $table_name => $table_data)
+ {
+ if (!isset($table_data['PRIMARY_KEY']))
+ {
+ $schema_data[$table_name]['COLUMNS']['mssqlindex'] = array('UINT', NULL, 'auto_increment');
+ $schema_data[$table_name]['PRIMARY_KEY'] = 'mssqlindex';
+ }
+ }
+ }
+
$fp = fopen($schema_path . $dbms . '_schema.sql', 'wb');
$line = '';
@@ -552,7 +565,7 @@ foreach ($supported_dbms as $dbms)
case 'mssql':
$line = substr($line, 0, -2);
- $line .= "\n) ON [PRIMARY]" . (($textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '') . "\n";
+ $line .= "\n)";// ON [PRIMARY]" . (($textimage) ? ' TEXTIMAGE_ON [PRIMARY]' : '') . "\n";
$line .= "GO\n\n";
break;
}
@@ -589,7 +602,7 @@ foreach ($supported_dbms as $dbms)
$line .= "\tCONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED \n";
$line .= "\t(\n";
$line .= "\t\t[" . implode("],\n\t\t[", $table_data['PRIMARY_KEY']) . "]\n";
- $line .= "\t) ON [PRIMARY] \n";
+ $line .= "\t)\n";
$line .= "GO\n\n";
break;
@@ -684,7 +697,7 @@ foreach ($supported_dbms as $dbms)
case 'mssql':
$line .= ($key_data[0] == 'INDEX') ? 'CREATE INDEX' : '';
$line .= ($key_data[0] == 'UNIQUE') ? 'CREATE UNIQUE INDEX' : '';
- $line .= " [{$key_name}] ON [{$table_name}]([" . implode('], [', $key_data[1]) . "]) ON [PRIMARY]\n";
+ $line .= " [{$key_name}] ON [{$table_name}]([" . implode('], [', $key_data[1]) . "])\n";
$line .= "GO\n\n";
break;