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
75d35f58
Commit
75d35f58
authored
Dec 20, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-555] Improved approach to fix issue from GH-367.
parent
2c1f6d71
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+3
-3
TableDiff.php
lib/Doctrine/DBAL/Schema/TableDiff.php
+10
-0
No files found.
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
75d35f58
...
...
@@ -527,7 +527,7 @@ class MySqlPlatform extends AbstractPlatform
$columnSql
=
array
();
$queryParts
=
array
();
if
(
$diff
->
newName
!==
false
)
{
$queryParts
[]
=
'RENAME TO '
.
$diff
->
newName
;
$queryParts
[]
=
'RENAME TO '
.
$diff
->
getNewName
()
->
getQuotedName
(
$this
)
;
}
foreach
(
$diff
->
addedColumns
as
$column
)
{
...
...
@@ -583,7 +583,7 @@ class MySqlPlatform extends AbstractPlatform
if
(
!
$this
->
onSchemaAlterTable
(
$diff
,
$tableSql
))
{
if
(
count
(
$queryParts
)
>
0
)
{
$sql
[]
=
'ALTER TABLE '
.
$diff
->
name
.
' '
.
implode
(
", "
,
$queryParts
);
$sql
[]
=
'ALTER TABLE '
.
$diff
->
getName
()
->
getQuotedName
(
$this
)
.
' '
.
implode
(
", "
,
$queryParts
);
}
$sql
=
array_merge
(
$this
->
getPreAlterTableIndexForeignKeySQL
(
$diff
),
...
...
@@ -601,7 +601,7 @@ class MySqlPlatform extends AbstractPlatform
protected
function
getPreAlterTableIndexForeignKeySQL
(
TableDiff
$diff
)
{
$sql
=
array
();
$table
=
$diff
->
name
;
$table
=
$diff
->
getName
()
->
getQuotedName
(
$this
)
;
foreach
(
$diff
->
removedIndexes
as
$remKey
=>
$remIndex
)
{
// Dropping primary keys requires to unset autoincrement attribute on the particular column first.
...
...
lib/Doctrine/DBAL/Schema/TableDiff.php
View file @
75d35f58
...
...
@@ -138,4 +138,14 @@ class TableDiff
$this
->
removedIndexes
=
$removedIndexes
;
$this
->
fromTable
=
$fromTable
;
}
public
function
getName
()
{
return
new
Identifier
(
$this
->
name
);
}
public
function
getNewName
()
{
return
new
Identifier
(
$this
->
newName
);
}
}
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