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
d34e2735
Commit
d34e2735
authored
Jan 13, 2014
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix unique indexes in CREATE TABLE statements on SQL Anywhere
parent
2790ee79
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
7 deletions
+4
-7
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+2
-6
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+2
-1
No files found.
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
d34e2735
...
@@ -1266,14 +1266,10 @@ class SQLAnywherePlatform extends AbstractPlatform
...
@@ -1266,14 +1266,10 @@ class SQLAnywherePlatform extends AbstractPlatform
if
(
!
empty
(
$options
[
'indexes'
]))
{
if
(
!
empty
(
$options
[
'indexes'
]))
{
/** @var \Doctrine\DBAL\Schema\Index $index */
/** @var \Doctrine\DBAL\Schema\Index $index */
foreach
((
array
)
$options
[
'indexes'
]
as
$name
=>
$index
)
{
foreach
((
array
)
$options
[
'indexes'
]
as
$index
)
{
if
(
$index
->
isUnique
())
{
$columnListSql
.=
', '
.
$this
->
getUniqueConstraintDeclarationSQL
(
$name
,
$index
);
}
else
{
$indexSql
[]
=
$this
->
getCreateIndexSQL
(
$index
,
$tableName
);
$indexSql
[]
=
$this
->
getCreateIndexSQL
(
$index
,
$tableName
);
}
}
}
}
}
if
(
!
empty
(
$options
[
'primary'
]))
{
if
(
!
empty
(
$options
[
'primary'
]))
{
$flags
=
''
;
$flags
=
''
;
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
d34e2735
...
@@ -52,7 +52,8 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
...
@@ -52,7 +52,8 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
public
function
getGenerateTableWithMultiColumnUniqueIndexSql
()
public
function
getGenerateTableWithMultiColumnUniqueIndexSql
()
{
{
return
array
(
return
array
(
'CREATE TABLE test (foo VARCHAR(255) DEFAULT NULL, bar VARCHAR(255) DEFAULT NULL, CONSTRAINT UNIQ_D87F7E0C8C73652176FF8CAA UNIQUE (foo, bar))'
,
'CREATE TABLE test (foo VARCHAR(255) DEFAULT NULL, bar VARCHAR(255) DEFAULT NULL)'
,
'CREATE UNIQUE INDEX UNIQ_D87F7E0C8C73652176FF8CAA ON test (foo, bar)'
);
);
}
}
...
...
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