Problem with Oracle number precision

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
entwicklungsensis
Posts: 17
Joined: Tue 21 Aug 2018 09:47

Problem with Oracle number precision

Post by entwicklungsensis » Wed 13 Nov 2019 14:26

Hello,
we are using \.nuget\packages\devart.data.oracle.efcore\9.7.805

I defined an Int64 Property "Id" in entity "adresse":
<class name="Adresse" entity-set="Adresses" p1:Guid="47ac3739-cba5-4d8b-8fb0-86ce712e4cad">
<id name="Id" type="Int64" value-generated="OnAdd" p1:ValidateRequired="true" p1:Guid="9503b5b0-1177-499c-9715-afef4fac6058">
<column name="" not-null="True" precision="18" scale="0" p1:unicode="False" />
</id>

When i add a migration via paket manager console ("dotnet ef migrations add InitialCreate") the generated class looks like this:
partial class InitalCreate
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.2.6-servicing-10079");

modelBuilder.Entity("TocanModel.Adresse", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd()
.HasColumnName("Id");
...

When i update the database with "dotnet ef database update" and have a look ath e newly created table it look like:
TABLE NPS."Adresse"
(
"Id" NUMBER(19) GENERATED AS IDENTITY ( START WITH 151794 MAXVALUE 9999999999999999999999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER NOKEEP) NOT NULL,
...

ef core has created a column with precision 19 not 18.
(same behaviour with all Int64 properties)

What am i doing wrong?

Regards
Thomas

entwicklungsensis
Posts: 17
Joined: Tue 21 Aug 2018 09:47

Re: Problem with Oracle number precision

Post by entwicklungsensis » Mon 18 Nov 2019 08:57

Hello devart team,
anyone has an answer to this?

Thomas

Shalex
Site Admin
Posts: 9040
Joined: Thu 14 Aug 2008 12:44

Re: Problem with Oracle number precision

Post by Shalex » Mon 18 Nov 2019 15:11

Thank you for your report. We have reproduced the issue and will notify you when it is fixed.

entwicklungsensis
Posts: 17
Joined: Tue 21 Aug 2018 09:47

Re: Problem with Oracle number precision

Post by entwicklungsensis » Fri 10 Jan 2020 13:55

Hello devart support,
can you say when these problem will be fixed?

Shalex
Site Admin
Posts: 9040
Joined: Thu 14 Aug 2008 12:44

Re: Problem with Oracle number precision

Post by Shalex » Mon 13 Jan 2020 19:23

<column name="" not-null="True" precision="18" scale="0" p1:unicode="False" />
As a workaround, please set sql-type="NUMBER(18)" in the model:

Code: Select all

<column name="" not-null="True" sql-type="NUMBER(18)" scale="0" p1:unicode="False" />

entwicklungsensis
Posts: 17
Joined: Tue 21 Aug 2018 09:47

Re: Problem with Oracle number precision

Post by entwicklungsensis » Fri 14 Feb 2020 08:26

Hi,
when will this be fixed?
We are using 9.10.921 (909 the same)
the error remains

paket-manager-console: script-migration (version):
Id, AktuerId and AdressId are of type INT64

CREATE TABLE "Eigentumer" (
"Id" NUMBER(19) NOT NULL,
"AkteurId" NUMBER(19) NOT NULL,
"AdresseId" NUMBER(19) NOT NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "FK_Eigentumer_Adresse_AdresseId" FOREIGN KEY ("AdresseId") REFERENCES "Adresse" ("Id")
ON DELETE CASCADE,
UNIQUE ("AkteurId")
)

Shalex
Site Admin
Posts: 9040
Joined: Thu 14 Aug 2008 12:44

Re: Problem with Oracle number precision

Post by Shalex » Mon 17 Feb 2020 11:13

There is no timeframe for the fix. Please use the workaround.

Post Reply