-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[6.0] Fix to #26271 - Temporal history table name always based on entity type name, not table name #26281
Conversation
@Pilchie for 6.0 approval. Low risk - changing temporal table naming pattern. Change is in the new feature and even if someone is using the RC version, we should just generate a simple history table rename (which we have tests for already) |
6898d78
to
52b407c
Compare
@@ -3858,7 +3858,7 @@ public virtual async Task History_table_schema_not_created_if_we_know_it_already | |||
[SystemTimeStart] datetime2 GENERATED ALWAYS AS ROW START HIDDEN NOT NULL, | |||
CONSTRAINT [PK_Orders] PRIMARY KEY ([Id]), | |||
PERIOD FOR SYSTEM_TIME([SystemTimeStart], [SystemTimeEnd]) | |||
) WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = [mySchema].[OrderHistory]));"); | |||
) WITH (SYSTEM_VERSIONING = ON (HISTORY_TABLE = [mySchema].[OrdersHistory]));"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a test for renaming just the history table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already have it: Rename_history_table
src/EFCore.SqlServer/Extensions/SqlServerEntityTypeExtensions.cs
Outdated
Show resolved
Hide resolved
Approved for EFCore 6.0 GA. |
…pe name, not table name When deciding on history table name use entityType.GetTableName() function instead of entity type name directly. Fixes #26271
When deciding on history table name use entityType.GetTableName() function instead of entity type name directly.
Fixes #26271
Customer impact
No impact for customers starting with RTM. For customers who were using pre-release versions of EFCore and were using the feature and were using default name for history table, we will generate a migration (history table rename) that they will have to execute to fix the model.
How found
Validating and documenting new features in EF Core 6.0.
Regression
No.
Testing
Several functional tests execute the code path, as well as testing the migration path from pre-release to RTM (assuming it contains this fix)
Risk
Low. We are changing temporal table naming pattern.