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
c48effb6
Commit
c48effb6
authored
May 10, 2017
by
Steve Müller
Committed by
GitHub
May 10, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2715 from dhensby/pulls/fix-2714
FIX Sequence::isAutoIncrementsFor now case insensitive
parents
e98d2416
106097a3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
Sequence.php
lib/Doctrine/DBAL/Schema/Sequence.php
+1
-1
SequenceTest.php
tests/Doctrine/Tests/DBAL/Schema/SequenceTest.php
+19
-0
No files found.
lib/Doctrine/DBAL/Schema/Sequence.php
View file @
c48effb6
...
...
@@ -149,7 +149,7 @@ class Sequence extends AbstractAsset
$sequenceName
=
$this
->
getShortestName
(
$table
->
getNamespaceName
());
$tableName
=
$table
->
getShortestName
(
$table
->
getNamespaceName
());
$tableSequenceName
=
sprintf
(
'%s_%s_seq'
,
$tableName
,
$
pkColumns
[
0
]
);
$tableSequenceName
=
sprintf
(
'%s_%s_seq'
,
$tableName
,
$
column
->
getShortestName
(
$table
->
getNamespaceName
())
);
return
$tableSequenceName
===
$sequenceName
;
}
...
...
tests/Doctrine/Tests/DBAL/Schema/SequenceTest.php
View file @
c48effb6
...
...
@@ -24,5 +24,24 @@ class SequenceTest extends \Doctrine\Tests\DbalTestCase
$this
->
assertFalse
(
$sequence2
->
isAutoIncrementsFor
(
$table
));
$this
->
assertFalse
(
$sequence3
->
isAutoIncrementsFor
(
$table
));
}
public
function
testIsAutoincrementForCaseInsensitive
()
{
$table
=
new
Table
(
'foo'
);
$table
->
addColumn
(
'ID'
,
'integer'
,
array
(
'autoincrement'
=>
true
));
$table
->
setPrimaryKey
(
array
(
'ID'
));
$sequence
=
new
Sequence
(
"foo_id_seq"
);
$sequence1
=
new
Sequence
(
"foo_ID_seq"
);
$sequence2
=
new
Sequence
(
"bar_id_seq"
);
$sequence3
=
new
Sequence
(
"bar_ID_seq"
);
$sequence4
=
new
Sequence
(
"other.foo_id_seq"
);
$this
->
assertTrue
(
$sequence
->
isAutoIncrementsFor
(
$table
));
$this
->
assertTrue
(
$sequence1
->
isAutoIncrementsFor
(
$table
));
$this
->
assertFalse
(
$sequence2
->
isAutoIncrementsFor
(
$table
));
$this
->
assertFalse
(
$sequence3
->
isAutoIncrementsFor
(
$table
));
$this
->
assertFalse
(
$sequence4
->
isAutoIncrementsFor
(
$table
));
}
}
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