Created
December 13, 2015 18:51
-
-
Save doctrinebot/90f981a01b4f4e662542 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DBAL-120 - https://github.com/doctrine/dbal/issues/1145
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Platforms/MySqlPlatform.old.php 2011-05-13 16:33:41.000000000 -0500 | |
+++ Platforms/MySqlPlatform.php 2011-05-13 16:31:42.000000000 -0500 | |
@@ -425,12 +425,12 @@ | |
foreach ($diff->changedColumns AS $columnDiff) { | |
/* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */ | |
$column = $columnDiff->column; | |
- $queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' ' | |
+ $queryParts[] = 'CHANGE ' . $this->quoteIdentifier($columnDiff->oldColumnName) . ' ' | |
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); | |
} | |
foreach ($diff->renamedColumns AS $oldColumnName => $column) { | |
- $queryParts[] = 'CHANGE ' . $oldColumnName . ' ' | |
+ $queryParts[] = 'CHANGE ' . $this->quoteIdentifier($oldColumnName) . ' ' | |
. $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Platforms/MySqlPlatform.old2.php 2011-05-13 17:01:00.000000000 -0500 | |
+++ Platforms/MySqlPlatform.php 2011-05-13 17:03:38.000000000 -0500 | |
@@ -357,7 +357,10 @@ | |
// attach all primary keys | |
if (isset($options['primary']) && ! empty($options['primary'])) { | |
- $keyColumns = array_unique(array_values($options['primary'])); | |
+ $keyColumns = array(); | |
+ foreach(array_unique(array_values($options['primary'])) as $keyColumn) { | |
+ $keyColumns[] = $this->quoteIdentifier($keyColumn); | |
+ } | |
$queryFields .= ', PRIMARY KEY(' . implode(', ', $keyColumns) . ')'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment