You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and in my DbContext, only Profile is included as a db set: public DbSet<Profile> Profiles { get; set; }
This causes the provider to generate address data inside the Profile table which is great, but Country and AddressLine1 are nullable while I configured them to be Required.
This is the generated migration part:
migrationBuilder.CreateTable(name:"Profiles",columns: table =>new{Id=table.Column<int>(nullable:false).Annotation("Npgsql:ValueGenerationStrategy",NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),CompanyName=table.Column<string>(nullable:false),Address_Country=table.Column<string>(nullable:true),Address_AddressLine1=table.Column<string>(nullable:true),Address_AddressLine2=table.Column<string>(nullable:true)},constraints: table =>{table.PrimaryKey("PK_Profiles", x =>x.Id);});
I expect both Address_Country and Address_AddressLine1 to be not nullable, as I just configured. I also tried configuring the same with FluentAPI but that did not work for me as well.
The text was updated successfully, but these errors were encountered:
Hi!
The NPGSQL team said this problem is in EF Core and not in their provider code. (npgsql/efcore.pg#1402)
In
Npgsql.EntityFrameworkCore.PostgreSQL
version3.1.4
,I have the following hierarchy:
and in my DbContext, only
Profile
is included as a db set:public DbSet<Profile> Profiles { get; set; }
This causes the provider to generate address data inside the
Profile
table which is great, butCountry
andAddressLine1
are nullable while I configured them to be Required.This is the generated migration part:
I expect both
Address_Country
andAddress_AddressLine1
to be not nullable, as I just configured. I also tried configuring the same with FluentAPI but that did not work for me as well.The text was updated successfully, but these errors were encountered: