I've been tasked with figuring out the impact of enabling temporal tables in our database. So I've been looking for a feature to enabling it to the entire database, and not just with:
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Employee>()
.ToTable("Employees", e => e.IsTemporal());
}
I haven't been able to find anything about this, is there anything that will just let me select the entire database, and then do it for each table?
I've downloaded some bigger database datasets to test the impact on. Hopefully, I can find a way to automate the conversion, so I don't have to manually apply the code to 100's of tables.
a feature to enabling it to the entire database
there's no such feature and would be a very, very bad idea anyway. Only some tables in any database need to be versioned. These will need different options. For example: anonymous history table, default or manual? If you want to query historical records you can't use an anonymous table. For such administration tasks the correct tool is a SQL script that performs the changes you want. You can use egselect table_name from INFORMATION_SCHEMA.Tables
to get the names of the tables you want and use code to generate the change script for each one – Goofball