Support for temporal tables for TPT (Table per Type) and other entity-splitting scenarios
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with SqlServerModelValidator.ValidateTemporalTables and the t => t.IsTemporal() configuration described in the issue. Reproduce the migration failure for TPT and entity-splitting mappings, then trace the temporal-table validation and migration behavior. Done means temporal tables work with these mappings without the current InvalidOperationException and are covered by appropriate tests.
Written by the indexing model from the issue text.
Description
Temporal tables for TPT tables
We are developing an application that currently use the concept of Table-Per-Type to minimize the duplication of fields instead of using a discriminator that is required with Table-Per-Hierarchy. More tables are planned in the future that will depend on the same parent table.
With the latest version of EF Core, we saw an opportunity to use the new temporal table support to easily keep track of operations in our tables. After adding t => t.IsTemporal() build action to our tables configuration and try to add a new migration, we received the following error:
Temporal tables are only supported for entities using Table-Per-Hierarchy inheritance mapping.
This message is returned through an InvalidOperationException in SqlServerModelValidator.ValidateTemporalTables when EF detect a derived table mapping in one of the tables for which we're trying to configure the temporal build action.
We were not able to find much information related to this restriction of temporal for TPT as per those are quite new features supported in EF Core 5 for TPT and EF Core 6 for temporal tables.
Is support planned in the future for both mechanisms to work on the same set of tables?
Thanks!
Version information
EF Core version: (6.0.0-rc.2.21480.5)
Database provider: (Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (.NET 6.0.0-rc.2.21480.5)
IDE: (e.g. Visual Studio 2022 17.0.0 Preview 6)
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 134
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/efcore
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
-
customer-reported
Difficulty 5/5 Over a week Newbie friendliness 38/100
-
area-cosmos area-vector-search
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-cosmos
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
area-tools needs-design
Difficulty 4/5 3-5 days Newbie friendliness 25/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100