-
-
Save doctrinebot/06a15b4b47a56e4c9163 to your computer and use it in GitHub Desktop.
Attachments to Doctrine Jira Issue DBAL-285 - https://github.com/doctrine/dbal/issues/1465
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
diff --git a/lib/Doctrine/DBAL/Schema/Table.php b/lib/Doctrine/DBAL/Schema/Table.php | |
--- a/lib/Doctrine/DBAL/Schema/Table.php | |
+++ b/lib/Doctrine/DBAL/Schema/Table.php | |
@@ -133,13 +133,15 @@ class Table extends AbstractAsset | |
*/ | |
public function setPrimaryKey(array $columns, $indexName = false) | |
{ | |
- $primaryKey = $this->_createIndex($columns, $indexName ?: "primary", true, true); | |
- | |
+ $unquotedColumns = array(); | |
foreach ($columns AS $columnName) { | |
$column = $this->getColumn($columnName); | |
$column->setNotnull(true); | |
+ $unquotedColumns[] = $column->getName(); | |
} | |
+ $primaryKey = $this->_createIndex($unquotedColumns, $indexName ?: "primary", true, true); | |
+ | |
return $primaryKey; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment