Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
cb38ff56
Commit
cb38ff56
authored
Sep 25, 2010
by
Juozas Kaziukenas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified createTable to not create IDENTITY colums for child tables
parent
976bb410
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
MsSqlPlatform.php
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
+29
-1
No files found.
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
View file @
cb38ff56
...
...
@@ -21,7 +21,7 @@ namespace Doctrine\DBAL\Platforms;
use
Doctrine\DBAL\Schema\TableDiff
;
use
Doctrine\DBAL\DBALException
;
use
Doctrine\DBAL\Schema\Index
;
use
Doctrine\DBAL\Schema\Index
,
Doctrine\DBAL\Schema\Table
;
/**
* The MsSqlPlatform provides the behavior, features and SQL dialect of the
...
...
@@ -150,6 +150,34 @@ DROP DATABASE ' . $name . ';';
/**
* @override
*/
public
function
getCreateTableSQL
(
Table
$table
,
$createFlags
=
self
::
CREATE_INDEXES
)
{
$sql
=
parent
::
getCreateTableSQL
(
$table
,
$createFlags
);
$primary
=
array
();
foreach
(
$table
->
getIndexes
()
AS
$index
)
{
/* @var $index Index */
if
(
$index
->
isPrimary
())
{
$primary
=
$index
->
getColumns
();
}
}
if
(
count
(
$primary
)
===
1
)
{
foreach
(
$table
->
getForeignKeys
()
AS
$definition
)
{
$columns
=
$definition
->
getLocalColumns
();
if
(
count
(
$columns
)
===
1
&&
in_array
(
$columns
[
0
],
$primary
))
{
$sql
[
0
]
=
str_replace
(
' IDENTITY'
,
''
,
$sql
[
0
]);
}
}
}
return
$sql
;
}
/**
* @override
*/
protected
function
_getCreateTableSQL
(
$tableName
,
array
$columns
,
array
$options
=
array
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment