I am using EF code first to create my migrations for an azure sql DB. I would like to start using "update" and "append only" ledger tables. I know i can set the whole DB to be update ledger, so that when I create new tables in the usual way, they will be automatically update ledger tables with a history table. But I would like to instead have the option of choosing which tables are update and which as append only. I can't find any recourses on how I would go about this. One of the tables I want to be append only would in fact be my MigrationsHistory table. Is there a way to do this with EF core?
--- Update [clarification] ---
I might now have been clear enough. Above.
What i am looking for is on how i would archive the required result using entity framework code first.
In other words using sql i could do something like this:
CREATE SCHEMA [AccessControl];
GO
CREATE TABLE [AccessControl].[KeyCardEvents]
(
[ID] INT NOT NULL,
[Timestamp] Datetime2 NOT NULL
)
WITH (LEDGER = ON (APPEND_ONLY = ON));
To get a table that would be append only. But if i want to create the model first like this:
public class AccessControl
{
public Int Id { get; set; }
public DateTime Timestamp{ get; set; }
}
Is there perhaps an attribute i could add to the class so that EF knows to make it an append only table? Or is there another way that can be done?
Also, please note that i also am curious how to make the __EFMigationsHistory table be an append only table. This table gets created the first time a migration is run on a database.