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
ba011757
Commit
ba011757
authored
Nov 28, 2009
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] - DDC-169 - Fix for breaking the building of Single-Table Inheritence in SchemaTool
parent
44cc6465
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
SchemaTool.php
lib/Doctrine/ORM/Tools/SchemaTool.php
+15
-4
No files found.
lib/Doctrine/ORM/Tools/SchemaTool.php
View file @
ba011757
...
...
@@ -246,12 +246,12 @@ class SchemaTool
}
}
try
{
/*
try {
$newSql = $schema->toSql($this->_platform);
#return $newSql;
} catch(\Exception $e) {
}
}
*/
// Append the sequence SQL
$sql
=
array_merge
(
$sql
,
$sequences
);
...
...
@@ -301,6 +301,7 @@ class SchemaTool
* @param ClassMetadata $class
* @param array $options The table options/constraints where any additional options/constraints
* that are required by columns should be appended.
* @param Table $table
* @return array The list of portable column definitions as required by the DBAL.
*/
private
function
_gatherColumns
(
$class
,
array
&
$options
,
$table
)
...
...
@@ -316,7 +317,12 @@ class SchemaTool
$pkColumns
[]
=
$column
[
'name'
];
}
}
$table
->
setPrimaryKey
(
$pkColumns
);
// For now, this is a hack required for single table inheritence, since this method is called
// twice by single table inheritence relations
if
(
!
$table
->
hasIndex
(
'primary'
))
{
$table
->
setPrimaryKey
(
$pkColumns
);
}
return
$columns
;
}
...
...
@@ -328,6 +334,7 @@ class SchemaTool
* @param array $mapping The field mapping.
* @param array $options The table options/constraints where any additional options/constraints
* required by the column should be appended.
* @param Table $table
* @return array The portable column definition as required by the DBAL.
*/
private
function
_gatherColumn
(
$class
,
array
$mapping
,
array
&
$options
,
$table
)
...
...
@@ -358,7 +365,11 @@ class SchemaTool
$column
[
'platformOptions'
][
'unique'
]
=
$column
[
'unique'
];
$column
[
'platformOptions'
][
'version'
]
=
$column
[
'version'
];
$table
->
createColumn
(
$column
[
'name'
],
$mapping
[
'type'
],
$column
);
if
(
$table
->
hasColumn
(
$column
[
'name'
]))
{
$table
->
changeColumn
(
$column
[
'name'
],
$column
);
}
else
{
$table
->
createColumn
(
$column
[
'name'
],
$mapping
[
'type'
],
$column
);
}
if
(
$class
->
isIdentifier
(
$mapping
[
'fieldName'
]))
{
$column
[
'primary'
]
=
true
;
...
...
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