Skip to content

Commit

Permalink
Merge pull request #815 from Wilt/patch-1
Browse files Browse the repository at this point in the history
Fix for inconsistent use of getSQLDeclaration
  • Loading branch information
Ocramius committed Mar 13, 2015
2 parents 6b6143b + 1f08072 commit facca9f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/en/reference/types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ Now we implement our ``Doctrine\DBAL\Types\Type`` instance:
{
const MONEY = 'money'; // modify to match your type name

public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
return 'MyMoney';
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -2206,7 +2206,7 @@ public function getColumnDeclarationSQL($name, array $field)
$check = (isset($field['check']) && $field['check']) ?
' ' . $field['check'] : '';

$typeDecl = $field['type']->getSqlDeclaration($field, $this);
$typeDecl = $field['type']->getSQLDeclaration($field, $this);
$columnDef = $typeDecl . $charset . $default . $notnull . $unique . $check . $collation;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/OraclePlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ public function getColumnDeclarationSQL($name, array $field)
$check = (isset($field['check']) && $field['check']) ?
' ' . $field['check'] : '';

$typeDecl = $field['type']->getSqlDeclaration($field, $this);
$typeDecl = $field['type']->getSQLDeclaration($field, $this);
$columnDef = $typeDecl . $default . $notnull . $unique . $check;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ public function getAlterTableSQL(TableDiff $diff)
$type = $column->getType();

// here was a server version check before, but DBAL API does not support this anymore.
$query = 'ALTER ' . $oldColumnName . ' TYPE ' . $type->getSqlDeclaration($column->toArray(), $this);
$query = 'ALTER ' . $oldColumnName . ' TYPE ' . $type->getSQLDeclaration($column->toArray(), $this);
$sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query;
}

Expand Down Expand Up @@ -546,7 +546,7 @@ public function getAlterTableSQL(TableDiff $diff)
}

if ($columnDiff->hasChanged('length')) {
$query = 'ALTER ' . $oldColumnName . ' TYPE ' . $column->getType()->getSqlDeclaration($column->toArray(), $this);
$query = 'ALTER ' . $oldColumnName . ' TYPE ' . $column->getType()->getSQLDeclaration($column->toArray(), $this);
$sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query;
}
}
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 @@ -1517,7 +1517,7 @@ public function getColumnDeclarationSQL($name, array $field)
$check = (isset($field['check']) && $field['check']) ?
' ' . $field['check'] : '';

$typeDecl = $field['type']->getSqlDeclaration($field, $this);
$typeDecl = $field['type']->getSQLDeclaration($field, $this);
$columnDef = $typeDecl . $collation . $notnull . $unique . $check;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private function getFederationTypeDefaultValue()
private function getCreateFederationStatement()
{
$federationType = Type::getType($this->shardManager->getDistributionType());
$federationTypeSql = $federationType->getSqlDeclaration(array(), $this->conn->getDatabasePlatform());
$federationTypeSql = $federationType->getSQLDeclaration(array(), $this->conn->getDatabasePlatform());

return "--Create Federation\n" .
"CREATE FEDERATION " . $this->shardManager->getFederationName() . " (" . $this->shardManager->getDistributionKey() . " " . $federationTypeSql ." RANGE)";
Expand Down

0 comments on commit facca9f

Please sign in to comment.