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
c40a24f7
Commit
c40a24f7
authored
Dec 22, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DBAL-585'
parents
a92784a1
5156391b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
32 additions
and
4 deletions
+32
-4
DB2Platform.php
lib/Doctrine/DBAL/Platforms/DB2Platform.php
+1
-1
DrizzlePlatform.php
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
+1
-1
MySqlPlatform.php
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
+1
-1
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+1
-1
ColumnDiff.php
lib/Doctrine/DBAL/Schema/ColumnDiff.php
+8
-0
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+20
-0
No files found.
lib/Doctrine/DBAL/Platforms/DB2Platform.php
View file @
c40a24f7
...
@@ -477,7 +477,7 @@ class DB2Platform extends AbstractPlatform
...
@@ -477,7 +477,7 @@ class DB2Platform extends AbstractPlatform
/* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff */
/* @var $columnDiff \Doctrine\DBAL\Schema\ColumnDiff */
$column
=
$columnDiff
->
column
;
$column
=
$columnDiff
->
column
;
$queryParts
[]
=
'ALTER '
.
(
$columnDiff
->
oldColumnName
)
.
' '
$queryParts
[]
=
'ALTER '
.
(
$columnDiff
->
getOldColumnName
()
->
getQuotedName
(
$this
)
)
.
' '
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$column
->
toArray
());
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$column
->
toArray
());
}
}
...
...
lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
View file @
c40a24f7
...
@@ -426,7 +426,7 @@ class DrizzlePlatform extends AbstractPlatform
...
@@ -426,7 +426,7 @@ class DrizzlePlatform extends AbstractPlatform
$column
=
$columnDiff
->
column
;
$column
=
$columnDiff
->
column
;
$columnArray
=
$column
->
toArray
();
$columnArray
=
$column
->
toArray
();
$columnArray
[
'comment'
]
=
$this
->
getColumnComment
(
$column
);
$columnArray
[
'comment'
]
=
$this
->
getColumnComment
(
$column
);
$queryParts
[]
=
'CHANGE '
.
(
$columnDiff
->
oldColumnName
)
.
' '
$queryParts
[]
=
'CHANGE '
.
(
$columnDiff
->
getOldColumnName
()
->
getQuotedName
(
$this
)
)
.
' '
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View file @
c40a24f7
...
@@ -557,7 +557,7 @@ class MySqlPlatform extends AbstractPlatform
...
@@ -557,7 +557,7 @@ class MySqlPlatform extends AbstractPlatform
$column
=
$columnDiff
->
column
;
$column
=
$columnDiff
->
column
;
$columnArray
=
$column
->
toArray
();
$columnArray
=
$column
->
toArray
();
$columnArray
[
'comment'
]
=
$this
->
getColumnComment
(
$column
);
$columnArray
[
'comment'
]
=
$this
->
getColumnComment
(
$column
);
$queryParts
[]
=
'CHANGE '
.
(
$columnDiff
->
oldColumnName
)
.
' '
$queryParts
[]
=
'CHANGE '
.
(
$columnDiff
->
getOldColumnName
()
->
getQuotedName
(
$this
)
)
.
' '
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
.
$this
->
getColumnDeclarationSQL
(
$column
->
getQuotedName
(
$this
),
$columnArray
);
}
}
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
c40a24f7
...
@@ -442,7 +442,7 @@ class PostgreSqlPlatform extends AbstractPlatform
...
@@ -442,7 +442,7 @@ class PostgreSqlPlatform extends AbstractPlatform
continue
;
continue
;
}
}
$oldColumnName
=
$columnDiff
->
oldColumnName
;
$oldColumnName
=
$columnDiff
->
getOldColumnName
()
->
getQuotedName
(
$this
)
;
$column
=
$columnDiff
->
column
;
$column
=
$columnDiff
->
column
;
if
(
$columnDiff
->
hasChanged
(
'type'
)
||
$columnDiff
->
hasChanged
(
'precision'
)
||
$columnDiff
->
hasChanged
(
'scale'
))
{
if
(
$columnDiff
->
hasChanged
(
'type'
)
||
$columnDiff
->
hasChanged
(
'precision'
)
||
$columnDiff
->
hasChanged
(
'scale'
))
{
...
...
lib/Doctrine/DBAL/Schema/ColumnDiff.php
View file @
c40a24f7
...
@@ -71,4 +71,12 @@ class ColumnDiff
...
@@ -71,4 +71,12 @@ class ColumnDiff
{
{
return
in_array
(
$propertyName
,
$this
->
changedProperties
);
return
in_array
(
$propertyName
,
$this
->
changedProperties
);
}
}
/**
* @return \Doctrine\DBAL\Schema\Identifier
*/
public
function
getOldColumnName
()
{
return
new
Identifier
(
$this
->
oldColumnName
);
}
}
}
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
c40a24f7
...
@@ -510,4 +510,24 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
...
@@ -510,4 +510,24 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
{
{
$this
->
_platform
->
schemaNeedsCreation
(
'schema'
);
$this
->
_platform
->
schemaNeedsCreation
(
'schema'
);
}
}
/**
* @group DBAL-585
*/
public
function
testAlterTableChangeQuotedColumn
()
{
$tableDiff
=
new
\Doctrine\DBAL\Schema\TableDiff
(
'mytable'
);
$tableDiff
->
fromTable
=
new
\Doctrine\DBAL\Schema\Table
(
'mytable'
);
$tableDiff
->
changedColumns
[
'foo'
]
=
new
\Doctrine\DBAL\Schema\ColumnDiff
(
'select'
,
new
\Doctrine\DBAL\Schema\Column
(
'select'
,
\Doctrine\DBAL\Types\Type
::
getType
(
'string'
)
),
array
(
'type'
)
);
$this
->
assertContains
(
$this
->
_platform
->
quoteIdentifier
(
'select'
),
implode
(
';'
,
$this
->
_platform
->
getAlterTableSQL
(
$tableDiff
))
);
}
}
}
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