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
e41a6458
Commit
e41a6458
authored
Sep 26, 2013
by
Artur Bodera
Committed by
Benjamin Eberlei
Dec 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix schema comparison with FK that contain quoted column names.
parent
121332f1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
2 deletions
+22
-2
Comparator.php
lib/Doctrine/DBAL/Schema/Comparator.php
+2
-2
ForeignKeyConstraint.php
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
+20
-0
No files found.
lib/Doctrine/DBAL/Schema/Comparator.php
View file @
e41a6458
...
...
@@ -322,11 +322,11 @@ class Comparator
*/
public
function
diffForeignKey
(
ForeignKeyConstraint
$key1
,
ForeignKeyConstraint
$key2
)
{
if
(
array_map
(
'strtolower'
,
$key1
->
get
LocalColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
get
LocalColumns
()))
{
if
(
array_map
(
'strtolower'
,
$key1
->
get
UnquotedLocalColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
getUnquoted
LocalColumns
()))
{
return
true
;
}
if
(
array_map
(
'strtolower'
,
$key1
->
get
ForeignColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
get
ForeignColumns
()))
{
if
(
array_map
(
'strtolower'
,
$key1
->
get
UnquotedForeignColumns
())
!=
array_map
(
'strtolower'
,
$key2
->
getUnquoted
ForeignColumns
()))
{
return
true
;
}
...
...
lib/Doctrine/DBAL/Schema/ForeignKeyConstraint.php
View file @
e41a6458
...
...
@@ -163,6 +163,26 @@ class ForeignKeyConstraint extends AbstractAsset implements Constraint
return
$columns
;
}
/**
* Returns unquoted representation of local table column names for comparison with other FK
*
* @return array
*/
public
function
getUnquotedLocalColumns
()
{
return
array_map
(
array
(
$this
,
'trimQuotes'
),
$this
->
getLocalColumns
());
}
/**
* Returns unquoted representation of foreign table column names for comparison with other FK
*
* @return array
*/
public
function
getUnquotedForeignColumns
()
{
return
array_map
(
array
(
$this
,
'trimQuotes'
),
$this
->
getForeignColumns
());
}
/**
* {@inheritdoc}
*
...
...
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