Open Moerup opened 1 day ago
I have the same problem.
In our CICD we are always recreating db, so we execute always all migrations. I have seen that the difference is near PeriodStart/PeriodEnd
GENERATED ALWAYS AS ROW START HIDDEN
is added in EF Core 9.
Our error says: cannot create generated always column when system_time period is not defined.
Migration regression from EF Core 8 to 9
I'm in the process of upgrading an application from .NET 8 to 9.
But I'm running into problems when trying to run existing migrations that have been created with EF Core 8 and working for over a year now on multiple versions of EF Core (8.0.4 to 8.0.11)
I have 2 migrations that throws exceptions and can't complete at all on v9.0.0, but if I revert to 8.0.11 it works fine. It's a series of multiple pretty complex migrations and changes over time, so creating a small repro will take some time, so I hope that's not necessary. Let me know if it is or you need more information!
Include your code
I have Temporal tables enabled for a model: "TestObjective" like this:
At some point we renamed a relations table from "TestObjectivesProjectRoles" to "TestObjectivesOwners". All this is auto generated with
dotnet-ef migrations add
But the migration generated to alter the temporal columns:Results in this error:
The second migration that fails is another rename of another table where we use rowversion configured like this:
With this migration created for altering the rowversion column:
And that throws this error:
Include provider and version information
EF Core version: 9.0.0 Database provider: Microsoft.EntityFrameworkCore.SqlServer Target framework: .NET 9.0 Operating system: Windows & Linux (Local & CICD) IDE: Visual Studio Enterprise 2022 17.12.0