efcore
efcore copied to clipboard
Allow specifying different column facets per table in TPT, TPC or entity splitting
Split off from #19811
modelBuilder.Entity<Customer>().ToTable("Customer");
modelBuilder.Entity<SpecialCustomer>().ToTable("SpecialCustomer", tb =>
{
tb.Property(c => c.Id)
.HasDefaultValue("1")
.HasDefaultConstrainName("blah")
.HasDefaultValueSql("newid()")
.HasComputedColumnSql("1")
.HasConversion<string>()
.HasColumnType("nvarchar(100)")
.IsRequired(false)
.HasMaxLength(100)
.IsUnicode(false)
.HasPrecision(1, 2)
.HasCollation("Latin1_General_BIN2");
});
@AndriySvyryd @ajcvickers I'm interested in #24685. Is this planned for EF Core 8 release by any chance?
@maximcus No. Vote (👍) for both issues so we consider them for future releases
This is also a problem for explicit constraint names (e.g. key constraint, default constraint)
This issue is making itself quite apparent when you want to set a database computed column on a TPC entity, but not others of the same inherited type.
Still using EF 6 because of this lack.
@Ukkie007 EF 6 is out of support. Also, AFAIK this isn't something that was supported in EF 6, so I'm not sure how keeping on that version helps.
I need Split mappings in a TPH scenario. As this case "Spilt mappings are not supported for hierarchies #34190" is closed being a duplicate, I repeat my question here. I am aware that EF6 is not supported anymore, but I don't see any alternative. More > 200 databases in production.
Ah sorry, you meant non-core EF6 before, rather than EF Core 6, my bad. FWIW non-core EF6 is technically not out of support, but is no longer being evolved (so would receive critical security fixes). Added ef6-parity label.