[release/6.0] Fix to #27375 - EF Core 6.0 temporal tables - migration rollback doesn't work #27379
+246
−6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem was that we were incorrectly using old table schema rather than history table schema when we were creating DropTableOperation for the history table, after versioning has been disabled.
Fix is to use the correct value.
Fixes #27375
Description
Problem was that we were incorrectly using actual table schema rather than history table schema when we were creating DropTableOperation for the history table, after versioning has been disabled.
Customer impact
Customers were unable to use revert temporal table to a regular table if the history table schema was different than the actual table schema.
How found
Reported by a customer on 6.0
Regression
No. Temporal tables is a new feature in 6.0
Testing
Added test for the affected scenario.
Risk
Minimal. The fix is trivial, correcting obviously incorrect value. Code path affected is very isolated - converting from temporal table to regular and doesn't get executed for any other scenario. Added a quirk to revert to old behavior, just in case.