efcore icon indicating copy to clipboard operation
efcore copied to clipboard

EF Core 6.0 temporal tables - Support specifying HISTORY_RETENTION_PERIOD

Open Mithras opened this issue 3 years ago • 2 comments

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
}));

Mithras avatar Jan 20 '22 01:01 Mithras

Hi! Any news on this kind of important feature? Thx

libertizer avatar Jul 10 '23 09:07 libertizer

@libertizer This issue is in the Backlog milestone. This means that it is not planned for the next release (EF Core 8.0). We will re-assess the backlog following the this release and consider this item at that time. However, keep in mind that there are many other high priority features with which it will be competing for resources. Make sure to vote (👍) for this issue if it is important to you.

ajcvickers avatar Jul 10 '23 09:07 ajcvickers

Hey, any updates on this?

b1tzer0 avatar Mar 06 '24 14:03 b1tzer0

@b1tzer0 please see the comment right before yours.

roji avatar Mar 06 '24 15:03 roji