Commit facca9fa authored by Marco Pivetta's avatar Marco Pivetta

Merge pull request #815 from Wilt/patch-1

Fix for inconsistent use of getSQLDeclaration
parents 6b6143ba 1f08072e
......@@ -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';
}
......
......@@ -2206,7 +2206,7 @@ abstract class AbstractPlatform
$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;
}
......
......@@ -890,7 +890,7 @@ END;';
$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;
}
......
......@@ -504,7 +504,7 @@ class PostgreSqlPlatform extends AbstractPlatform
$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;
}
......@@ -546,7 +546,7 @@ class PostgreSqlPlatform extends AbstractPlatform
}
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;
}
}
......
......@@ -1517,7 +1517,7 @@ class SQLServerPlatform extends AbstractPlatform
$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;
}
......
......@@ -290,7 +290,7 @@ class SQLAzureFederationsSynchronizer extends AbstractSchemaSynchronizer
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)";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment