Skip to content

Commit

Permalink
Merge pull request #3143 from AlessandroMinoccheri/initalize_array
Browse files Browse the repository at this point in the history
initialize sql array into platform files
  • Loading branch information
morozov authored May 15, 2018
2 parents 7021bdf + 4fa36f1 commit 730fec4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/DrizzlePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ protected function _getCreateTableSQL($tableName, array $columns, array $options
$query .= $this->buildTableOptions($options);
$query .= $this->buildPartitionOptions($options);

$sql[] = $query;
$sql = [$query];

if (isset($options['foreignKeys'])) {
foreach ((array) $options['foreignKeys'] as $definition) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ protected function _getCreateTableSQL($tableName, array $columns, array $options
$query .= $this->buildTableOptions($options);
$query .= $this->buildPartitionOptions($options);

$sql[] = $query;
$sql = [$query];
$engine = 'INNODB';

if (isset($options['engine'])) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ protected function _getCreateTableSQL($tableName, array $columns, array $options

$query = 'CREATE TABLE ' . $tableName . ' (' . $queryFields . ')';

$sql[] = $query;
$sql = [$query];

if (isset($options['indexes']) && ! empty($options['indexes'])) {
foreach ($options['indexes'] as $index) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ protected function _getCreateTableSQL($tableName, array $columns, array $options
}
$query .= ')';

$sql[] = $query;
$sql = [$query];

if (isset($options['indexes']) && !empty($options['indexes'])) {
foreach ($options['indexes'] as $index) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/SqlitePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ protected function _getCreateTableSQL($name, array $columns, array $options = []
}
}

$query[] = 'CREATE TABLE ' . $name . ' (' . $queryFields . ')';
$query = ['CREATE TABLE ' . $name . ' (' . $queryFields . ')'];

if (isset($options['alter']) && true === $options['alter']) {
return $query;
Expand Down

0 comments on commit 730fec4

Please sign in to comment.