mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Oracle - Unable to set precision to the database setting #5705
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @nuncanada on GitHub (Sep 19, 2017).
Our current database has been created with the NUMBER datatype without any precision parameter.
Is it possible to configure Doctrine to not use any precision parameter?
For some reason Doctrine defaults to precision 10? I am trying to make Doctrine output the correct precision (which could be *) but unable to do so because Doctrine is checking for an integer:
[Doctrine\Common\Annotations\AnnotationException]
[Type Error] Attribute "precision" of @ORM\Column declared on property Stm\Model\SIPOC_WEB\TbResposta::$id expects a(n) integer, but got string.
I have already tried to put precision=38 which is the maximum precision for Oracle, but for some reason Oracle still thinks we are trying to change the precision when modifying the datatype from NUMBER to NUMBER(38).
The coversion does work from NUMBER to NUMBER(*).
@cyframepaul commented on GitHub (Nov 30, 2017):
@nuncanada you can just extend the OraclePlatform getIntegerTypeDeclarationSQL in your project if you have this requirement. Alternatively, you could add a custom mapping type that extends IntegerType..
Here is an example of extending OraclePlatform. Adjust as needed.
Add this to your configs:
And extend OraclePlatform like so:
@beberlei commented on GitHub (Dec 8, 2020):
Yes custom type is the solution.