You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Temporal Tables: The given key 'SqlServer:TemporalHistoryTableName' was not present in the dictionary when creating migration on entity mapped to temporal table without explicitly providing history table name #25511
problem happens when trying to create migrations for model containing entity mapped to temporal table, if the history table is not explicitly specified, e.g.
System.Collections.Generic.KeyNotFoundException: The given key 'SqlServer:TemporalHistoryTableName' was not present in the dictionary.
at System.Collections.Generic.Dictionary`2.get_Item(TKey key) in System.Private.CoreLib.dll:token 0x600675e+0x17
at Microsoft.EntityFrameworkCore.SqlServer.Design.Internal.SqlServerAnnotationCodeGenerator.GenerateFluentApiCalls(IEntityType entityType, IDictionary`2 annotations) in Microsoft.EntityFrameworkCore.SqlServer.dll:token 0x60004c2+0x45
at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.GenerateEntityTypeAnnotations(String builderName, IEntityType entityType, IndentedStringBuilder stringBuilder) in Microsoft.EntityFrameworkCore.Design.dll:token 0x600032b+0x67d
at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.GenerateEntityType(String builderName, IEntityType entityType, IndentedStringBuilder stringBuilder) in Microsoft.EntityFrameworkCore.Design.dll:token 0x600031a+0x1bd
at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpSnapshotGenerator.GenerateEntityTypes(String builderName, IReadOnlyList`1 entityTypes, IndentedStringBuilder stringBuilder) in Microsoft.EntityFrameworkCore.Design.dll:token 0x6000319+0x5f
at Microsoft.EntityFrameworkCore.Migrations.Design.CSharpMigrationsGenerator.GenerateMetadata(String migrationNamespace, Type contextType, String migrationName, String migrationId, IModel targetModel) in Microsoft.EntityFrameworkCore.Design.dll:token 0x6000302+0x208
at Microsoft.EntityFrameworkCore.Migrations.Design.MigrationsScaffolder.ScaffoldMigration(String migrationName, String rootNamespace, String subNamespace, String language) in Microsoft.EntityFrameworkCore.Design.dll:token 0x600038c+0x2b3
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType, String namespace) in Microsoft.EntityFrameworkCore.Design.dll:token 0x6000474+0xa5
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType, String namespace) in Microsoft.EntityFrameworkCore.Design.dll:token 0x60003e5+0xc
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigration.<>c__DisplayClass0_0.<.ctor>b__0() in Microsoft.EntityFrameworkCore.Design.dll:token 0x60006df+0x0
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0() in Microsoft.EntityFrameworkCore.Design.dll:token 0x60006f3+0x0
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) in Microsoft.EntityFrameworkCore.Design.dll:token 0x600066a+0xc
Activity
maumar commentedon Aug 13, 2021
Workaround: specify history table name
Fix to #25511 - Temporal Tables: The given key 'SqlServer:TemporalHis…
Fix to #25511 - Temporal Tables: The given key 'SqlServer:TemporalHis…
Fix to #25511 - Temporal Tables: The given key 'SqlServer:TemporalHis…
Fix to #25511 - Temporal Tables: The given key 'SqlServer:TemporalHis…
Fix to #25511 - Temporal Tables: The given key 'SqlServer:TemporalHis…