From 36dc641dc8a6270c29bc9745429a3be6e4ec23e4 Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Wed, 27 Nov 2024 17:38:16 +0100 Subject: [PATCH] Temporary fix for DropTable/CreateTable issue around temporal tables Fixes #35162 --- .../Migrations/SqlServerMigrationsSqlGenerator.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs b/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs index 14fd173e8d7..c5644c265d0 100644 --- a/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs +++ b/src/EFCore.SqlServer/Migrations/SqlServerMigrationsSqlGenerator.cs @@ -2606,9 +2606,8 @@ private IReadOnlyList RewriteOperations( operations.Add(operation); } - // we removed the table, so we no longer need it's temporal information - // there will be no more operations involving this table - temporalTableInformationMap.Remove((tableName, schema)); + // Note that we leave the information in temporalTableInformationMap in case there's a later CreateTable operation + // on the same table name (see #35162). break; }