Column precision is not specified #7320

Closed
opened 2026-01-22 15:49:52 +01:00 by admin · 6 comments
Owner

Originally created by @ben29 on GitHub (Feb 12, 2024).

Hi.
I update to last version of doctrine/ORM (3.0)

using Symfony last version.

Getting error:

php bin/console doctrine:schema:update --force --complete

In InvalidColumnDeclaration.php line 17:

Column "fee" has invalid type

In ColumnPrecisionRequired.php line 18:

Column precision is not specified

#[ORM\Column(name: 'fee', type: 'decimal', precision: 2, scale: 2, unique: false, nullable: false)]
#[Assert\NotBlank]
private string $fee = '0.0';

Also
remove the "precision: 2," will not help.

something wrong with decimal type.

Originally created by @ben29 on GitHub (Feb 12, 2024). Hi. I update to last version of doctrine/ORM (3.0) using Symfony last version. Getting error: `php bin/console doctrine:schema:update --force --complete` > In InvalidColumnDeclaration.php line 17: > > Column "fee" has invalid type > > > In ColumnPrecisionRequired.php line 18: > > Column precision is not specified > > > #[ORM\Column(name: 'fee', type: 'decimal', precision: 2, scale: 2, unique: false, nullable: false)] #[Assert\NotBlank] private string $fee = '0.0'; Also remove the "precision: 2," will not help. something wrong with decimal type.
admin closed this issue 2026-01-22 15:49:52 +01:00
Author
Owner

@ben29 commented on GitHub (Mar 4, 2024):

any kind of update?

@derrabus - sorry to tag you, but can you help ?

@ben29 commented on GitHub (Mar 4, 2024): any kind of update? @derrabus - sorry to tag you, but can you help ?
Author
Owner

@derrabus commented on GitHub (Mar 6, 2024):

That declaration looks suspicious to me. Doesn't the precision have to be greater than the scale? Apart from that, feel free to dig a little into the issue. I don't have time to do that at the moment.

@derrabus commented on GitHub (Mar 6, 2024): That declaration looks suspicious to me. Doesn't the precision have to be greater than the scale? Apart from that, feel free to dig a little into the issue. I don't have time to do that at the moment.
Author
Owner

@ben29 commented on GitHub (Mar 10, 2024):

before version 4
I didn’t put the precision,
only the scale and its working.
something happen with the decimal.

@ben29 commented on GitHub (Mar 10, 2024): before version 4 I didn’t put the precision, only the scale and its working. something happen with the decimal.
Author
Owner

@derrabus commented on GitHub (Mar 10, 2024):

Yes, precision and scale are both mandatory now.

@derrabus commented on GitHub (Mar 10, 2024): Yes, precision and scale are both mandatory now.
Author
Owner

@ben29 commented on GitHub (Mar 10, 2024):

Ok. But it’s not working…
No matter what I try.

@ben29 commented on GitHub (Mar 10, 2024): Ok. But it’s not working… No matter what I try.
Author
Owner

@ben29 commented on GitHub (Mar 10, 2024):

I try also:

    #[ORM\Column(name: 'fee', type: Types::DECIMAL, precision: 10, scale: 2)]
    private ?string $fee = '0';

the error:

In InvalidColumnDeclaration.php line 17:

Column "fee" has invalid type

In ColumnPrecisionRequired.php line 18:

Column precision is not specified

I think maybe it doesn't accept the precision at all.

@ben29 commented on GitHub (Mar 10, 2024): I try also: ``` #[ORM\Column(name: 'fee', type: Types::DECIMAL, precision: 10, scale: 2)] private ?string $fee = '0'; ``` the error: > > In InvalidColumnDeclaration.php line 17: > > Column "fee" has invalid type > > > In ColumnPrecisionRequired.php line 18: > > Column precision is not specified I think maybe it doesn't accept the precision at all.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7320