When a new column is added for float type with scale and precision they are ignored.
$table->addColumn($name, Type::FLOAT)->setPrecision($precision)->setScale($scale);
will produce DOUBLE (in MySQL) no matter what is given in $precision and $scale.
The only usage of getPrecision and getScale is here.
I think the problem is with method AbstractPlatform::getFloatDeclarationSQL
public function getFloatDeclarationSQL(array $fieldDeclaration)
{
return 'DOUBLE PRECISION';
}
it receives valid precision and scale but just ignores the values
array (
'name' => 'latitude',
'type' =>
Doctrine\DBAL\Types\FloatType::__set_state(array(
)),
'default' => NULL,
'notnull' => true,
'length' => NULL,
'precision' => 17,
'scale' => 14,
'fixed' => false,
'unsigned' => false,
'autoincrement' => false,
'columnDefinition' => NULL,
'comment' => NULL,
'version' => false,
)
Same issue here
Same here
+1
Most helpful comment
I think the problem is with method AbstractPlatform::getFloatDeclarationSQL
it receives valid
precisionandscalebut just ignores the values