Problem with Oracle number precision
-
- Posts: 5
- Joined: Tue 21 Aug 2018 09:47
Problem with Oracle number precision
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
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
-
- Posts: 5
- Joined: Tue 21 Aug 2018 09:47
Re: Problem with Oracle number precision
Hello devart team,
anyone has an answer to this?
Thomas
anyone has an answer to this?
Thomas
Re: Problem with Oracle number precision
Thank you for your report. We have reproduced the issue and will notify you when it is fixed.
-
- Posts: 5
- Joined: Tue 21 Aug 2018 09:47
Re: Problem with Oracle number precision
Hello devart support,
can you say when these problem will be fixed?
can you say when these problem will be fixed?
Re: Problem with Oracle number precision
As a workaround, please set sql-type="NUMBER(18)" in the model:<column name="" not-null="True" precision="18" scale="0" p1:unicode="False" />
Code: Select all
<column name="" not-null="True" sql-type="NUMBER(18)" scale="0" p1:unicode="False" />
-
- Posts: 5
- Joined: Tue 21 Aug 2018 09:47
Re: Problem with Oracle number precision
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")
)
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")
)
Re: Problem with Oracle number precision
There is no timeframe for the fix. Please use the workaround.