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
7e0266c9
Commit
7e0266c9
authored
Apr 06, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #299 from deeky666/fix-sql-server-composite-foreign-keys
Fix list SQL Server composite foreign keys
parents
eef9d760
1cb7827a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
10 deletions
+35
-10
SQLServerSchemaManager.php
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
+35
-10
No files found.
lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php
View file @
7e0266c9
...
...
@@ -109,6 +109,34 @@ class SQLServerSchemaManager extends AbstractSchemaManager
return
$column
;
}
/**
* {@inheritdoc}
*/
protected
function
_getPortableTableForeignKeysList
(
$tableForeignKeys
)
{
$foreignKeys
=
array
();
foreach
(
$tableForeignKeys
as
$tableForeignKey
)
{
if
(
!
isset
(
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]]))
{
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]]
=
array
(
'local_columns'
=>
array
(
$tableForeignKey
[
'ColumnName'
]),
'foreign_table'
=>
$tableForeignKey
[
'ReferenceTableName'
],
'foreign_columns'
=>
array
(
$tableForeignKey
[
'ReferenceColumnName'
]),
'name'
=>
$tableForeignKey
[
'ForeignKey'
],
'options'
=>
array
(
'onUpdate'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'update_referential_action_desc'
]),
'onDelete'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'delete_referential_action_desc'
])
)
);
}
else
{
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]][
'local_columns'
][]
=
$tableForeignKey
[
'ColumnName'
];
$foreignKeys
[
$tableForeignKey
[
'ForeignKey'
]][
'foreign_columns'
][]
=
$tableForeignKey
[
'ReferenceColumnName'
];
}
}
return
parent
::
_getPortableTableForeignKeysList
(
$foreignKeys
);
}
/**
* @override
*/
...
...
@@ -167,19 +195,16 @@ class SQLServerSchemaManager extends AbstractSchemaManager
}
/**
*
@override
*
{@inheritdoc}
*/
p
ublic
function
_getPortableTableForeignKeyDefinition
(
$tableForeignKey
)
p
rotected
function
_getPortableTableForeignKeyDefinition
(
$tableForeignKey
)
{
return
new
ForeignKeyConstraint
(
(
array
)
$tableForeignKey
[
'ColumnName'
],
$tableForeignKey
[
'ReferenceTableName'
],
(
array
)
$tableForeignKey
[
'ReferenceColumnName'
],
$tableForeignKey
[
'ForeignKey'
],
array
(
'onUpdate'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'update_referential_action_desc'
]),
'onDelete'
=>
str_replace
(
'_'
,
' '
,
$tableForeignKey
[
'delete_referential_action_desc'
]),
)
$tableForeignKey
[
'local_columns'
],
$tableForeignKey
[
'foreign_table'
],
$tableForeignKey
[
'foreign_columns'
],
$tableForeignKey
[
'name'
],
$tableForeignKey
[
'options'
]
);
}
...
...
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