findulov / EntityFrameworkCore.TemporalTables

Extension library which allows developers to easily use temporal tables in SQL Server using Entity Framework Core.
MIT License
63 stars 19 forks source link

How to migrate to EF6 temporal tables? #36

Open m4tf3r opened 2 years ago

m4tf3r commented 2 years ago

I upgraded my project to EF6 and this library no longer works, so I enabled temporal tables for my entities using EF6 integrated system. However when I create a new migration it tries to create temporal tables as if they never existed, so when applying it to the db it fails. Is there a suggested way to deal with this?

M2xAy commented 2 years ago

I upgared also to EF6 ans now I receive the error Boolean Microsoft.EntityFrameworkCore.EntityTypeExtensions.IsOwned(Microsoft.EntityFrameworkCore.Metadata.IEntityType)

when plan you update the packsge ?

Best regrads.

benspencer-ecs commented 2 years ago

@m4tf3r I have the exact same issue. Is there a workaround to this other than deleting the parts of the migration that are trying to update the tables to be temporal?

m4tf3r commented 2 years ago

Is there a workaround to this other than deleting the parts of the migration that are trying to update the tables to be temporal?

I solved my situation by putting in the new migration the sql code generated by this library to create the temporal tables. The code creates each temporal table only if it doesn't exist, so no problem if they are already present.