[DBAL-77] Mysql Numeric / Decimal fields Created: 13/Dec/10  Updated: 04/Jan/13  Resolved: 15/Mar/12

Status: Closed
Project: Doctrine DBAL
Component/s: None
Affects Version/s: 2.0.0-BETA4, 2.0, 2.0.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Eugene Assignee: Benjamin Eberlei
Resolution: Can't Fix Votes: 2
Labels: None

mysql 5.1.49 for debian-linux-gnu (x86_64), Ubuntu 10.10 Doctrine DBAL Beta4 Doctrine ORM Beta4 Doctrine Common RC1


class product {
*Column(type="decimal", scale="2")
private $discount;

generate SQL

create table product {
discount DECIMAL(10,2) NOT NULL

if you have a field in a database type DECIMAL doctrine tries to
generate for him diff

doctrine orm:schema-tool
ALTER TABLE product CHANGE discrount discrount NUMERIC (10, 2) NOT NULL

but mysql ignore the alter, as a result of these diff stretch from
migration to migration

Comment by Benjamin Eberlei [ 13/Dec/10 ]

This is fixed in RC1 or RC2.

Comment by Eugene [ 20/Jan/11 ]

checked for the version of doctrine 2.1.0-DEV
result is the same

Comment by Oleg Anashkin [ 31/Jan/11 ]

I have the same issue with the latest doctrine build. Please fix it because it makes schema migration scripts dirty with redundant changes.

Comment by Benjamin Eberlei [ 04/Mar/11 ]

I cannot reproduce this, does this happen if you also specify precision=10 ?

Comment by Alexander [ 15/Mar/12 ]

Closing until someone can provide more feedback.

Comment by Joel Simpson [ 04/Jan/13 ]

I am seeing this bug for a definition specified as:

  • @ORM\Column(type="decimal", precision=20, scale=0, nullable=false, unique=true)

Doctrine Command Line Interface version 2.3.2-DEV

Generated at Tue Dec 01 13:17:40 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.