Problem with Oracle number precision
Posted: 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
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