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
292d5edd
Commit
292d5edd
authored
Nov 12, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DBAL-379' into 2.3
parents
97801a74
649bfeb5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+1
-1
SQLServerPlatformTest.php
...s/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
+6
-0
No files found.
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
292d5edd
...
...
@@ -256,7 +256,7 @@ class SQLServerPlatform extends AbstractPlatform
{
$constraint
=
parent
::
getCreateIndexSQL
(
$index
,
$table
);
if
(
$index
->
isUnique
())
{
if
(
$index
->
isUnique
()
&&
!
$index
->
isPrimary
()
)
{
$constraint
=
$this
->
_appendUniqueConstraintDefinition
(
$constraint
,
$index
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
View file @
292d5edd
...
...
@@ -221,4 +221,10 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
$idx
->
addFlag
(
'nonclustered'
);
$this
->
assertEquals
(
'ALTER TABLE tbl ADD PRIMARY KEY NONCLUSTERED (id)'
,
$this
->
_platform
->
getCreatePrimaryKeySQL
(
$idx
,
'tbl'
));
}
public
function
testAlterAddPrimaryKey
()
{
$idx
=
new
\Doctrine\DBAL\Schema\Index
(
'idx'
,
array
(
'id'
),
false
,
true
);
$this
->
assertEquals
(
'ALTER TABLE tbl ADD PRIMARY KEY (id)'
,
$this
->
_platform
->
getCreateIndexSQL
(
$idx
,
'tbl'
));
}
}
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