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
17c1ee56
Commit
17c1ee56
authored
Apr 14, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DBAL-492' into 2.3
parents
dd69835e
622fe3ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
Comparator.php
lib/Doctrine/DBAL/Schema/Comparator.php
+1
-1
ForeignKeyConstraint.php
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
+11
-0
ComparatorTest.php
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
+12
-0
No files found.
lib/Doctrine/DBAL/Schema/Comparator.php
View file @
17c1ee56
...
...
@@ -317,7 +317,7 @@ class Comparator
return
true
;
}
if
(
strtolower
(
$key1
->
getForeignTableName
())
!=
strtolower
(
$key2
->
getForeignTableName
()
))
{
if
(
$key1
->
getUnqualifiedForeignTableName
()
!==
$key2
->
getUnqualifiedForeignTableName
(
))
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
View file @
17c1ee56
...
...
@@ -110,6 +110,17 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
return
$this
->
_foreignTableName
;
}
/**
* Return the non-schema qualified foreign table name.
*
* @return string
*/
public
function
getUnqualifiedForeignTableName
()
{
$parts
=
explode
(
"."
,
$this
->
_foreignTableName
);
return
strtolower
(
end
(
$parts
));
}
/**
* Get the quoted representation of this asset but only if it was defined with one. Otherwise
* return the plain unquoted value as inserted.
...
...
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
View file @
17c1ee56
...
...
@@ -604,6 +604,18 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$this
->
assertFalse
(
$c
->
diffForeignKey
(
$fk1
,
$fk2
));
}
/**
* @group DBAL-492
*/
public
function
testCompareForeignKeyNamesUnqualified_AsNoSchemaInformationIsAvailable
()
{
$fk1
=
new
ForeignKeyConstraint
(
array
(
"foo"
),
"foo.bar"
,
array
(
"baz"
),
"fk1"
);
$fk2
=
new
ForeignKeyConstraint
(
array
(
"foo"
),
"baz.bar"
,
array
(
"baz"
),
"fk1"
);
$c
=
new
Comparator
();
$this
->
assertFalse
(
$c
->
diffForeignKey
(
$fk1
,
$fk2
));
}
public
function
testDetectRenameColumn
()
{
$tableA
=
new
Table
(
"foo"
);
...
...
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