EF Core 6.0 temporal tables - Support specifying HISTORY_RETENTION_PERIOD
- Dominant language
- C#
- Stars
- 14.8k
- Forks
- 3.4k
- PR merge metrics
- PR metrics pending
Description
**What problem are you trying to solve?**
Right now there is no way to specify HISTORY_RETENTION_PERIOD when defining a temporal table. Also, EF Core doesn't create create a clustered index for PeriodEnd and PeriodStart columns in history table which is a prerequisite to use HISTORY_RETENTION_PERIOD.
**Describe the solution you'd like**
```
builder.ToTable(tableBuilder => tableBuilder.IsTemporal(temporalTableBuilder =>
{
temporalTableBuilder.HasPeriodStart("MyPeriodStart");
temporalTableBuilder.HasPeriodEnd("MyPeriodEnd");
temporalTableBuilder.UseHistoryTable("MyHistory");
temporalTableBuilder.UseHistoryRetentionPeriod("12 MONTHS"); // <--- something like this
}));
```
Contributor guide
Assessment
This issue has not been assessed yet.