Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions phpBB/develop/create_schema_files.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,19 @@

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', 'wt');

$line = '';
Expand Down Expand Up @@ -552,7 +565,7 @@

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;
}
Expand Down Expand Up @@ -589,7 +602,7 @@
$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";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace can be removed?
Same below

$line .= "GO\n\n";
break;

Expand Down Expand Up @@ -684,7 +697,7 @@
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;

Expand Down
Loading