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
91e15b7e
Commit
91e15b7e
authored
Nov 17, 2010
by
Juozas Kaziukenas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed unique key constraints with multiple columns
parent
76e148a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
MsSqlPlatform.php
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
+1
-1
MsSqlPlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/MsSqlPlatformTest.php
+2
-2
No files found.
lib/Doctrine/DBAL/Platforms/MsSqlPlatform.php
View file @
91e15b7e
...
@@ -263,7 +263,7 @@ class MsSqlPlatform extends AbstractPlatform
...
@@ -263,7 +263,7 @@ class MsSqlPlatform extends AbstractPlatform
$fields
[]
=
$field
.
' IS NOT NULL'
;
$fields
[]
=
$field
.
' IS NOT NULL'
;
}
}
return
$sql
.
' WHERE '
.
implode
(
'
OR
'
,
$fields
);
return
$sql
.
' WHERE '
.
implode
(
'
AND
'
,
$fields
);
}
}
/**
/**
...
...
tests/Doctrine/Tests/DBAL/Platforms/MsSqlPlatformTest.php
View file @
91e15b7e
...
@@ -24,7 +24,7 @@ class MsSqlPlatformTest extends AbstractPlatformTestCase
...
@@ -24,7 +24,7 @@ class MsSqlPlatformTest extends AbstractPlatformTestCase
{
{
return
array
(
return
array
(
'CREATE TABLE test (foo NVARCHAR(255) DEFAULT NULL, bar NVARCHAR(255) DEFAULT NULL)'
,
'CREATE TABLE test (foo NVARCHAR(255) DEFAULT NULL, bar NVARCHAR(255) DEFAULT NULL)'
,
'CREATE UNIQUE INDEX test_foo_bar_uniq ON test (foo, bar)'
'CREATE UNIQUE INDEX test_foo_bar_uniq ON test (foo, bar)
WHERE foo IS NOT NULL AND bar IS NOT NULL
'
);
);
}
}
...
@@ -133,7 +133,7 @@ class MsSqlPlatformTest extends AbstractPlatformTestCase
...
@@ -133,7 +133,7 @@ class MsSqlPlatformTest extends AbstractPlatformTestCase
public
function
getGenerateUniqueIndexSql
()
public
function
getGenerateUniqueIndexSql
()
{
{
return
'CREATE UNIQUE INDEX index_name ON test (test, test2)'
;
return
'CREATE UNIQUE INDEX index_name ON test (test, test2)
WHERE test IS NOT NULL AND test2 IS NOT NULL
'
;
}
}
public
function
getGenerateForeignKeySql
()
public
function
getGenerateForeignKeySql
()
...
...
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