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
Hi.
Had existing project on .net6/ef6.
Upgraded project to .net7/ef7.
Added new task type with migration and newly generated migration is failing.
See, example repo.
PS C:\repos\github\dotnet-ef-tbh-test\TestApp> dotnet ef database update
Build started...
Build succeeded.
Applying migration '20221130081757_Init'.
Applying migration '20221130083118_AddTaskC'.
System.InvalidOperationException: Table name must be specified to configure a table-specific property mapping.
at Microsoft.EntityFrameworkCore.Metadata.Builders.TableBuilder.GetStoreObjectIdentifier()
at Microsoft.EntityFrameworkCore.Metadata.Builders.TableBuilder.Property(String propertyName)
at TestApp.Migrations.AddTaskC.<>c.<BuildTargetModel>b__2_4(TableBuilder t) in C:\repos\github\dotnet-ef-tbh-test\TestApp\Migrations\20221130083118_AddTaskC.Designer.cs:line 63
at Microsoft.EntityFrameworkCore.RelationalEntityTypeBuilderExtensions.ToTable(EntityTypeBuilder entityTypeBuilder, Action`1 buildAction)
at TestApp.Migrations.AddTaskC.<>c.<BuildTargetModel>b__2_1(EntityTypeBuilder b) in C:\repos\github\dotnet-ef-tbh-test\TestApp\Migrations\20221130083118_AddTaskC.Designer.cs:line 61
at Microsoft.EntityFrameworkCore.ModelBuilder.Entity(String name, Action`1 buildAction)
at TestApp.Migrations.AddTaskC.BuildTargetModel(ModelBuilder modelBuilder) in C:\repos\github\dotnet-ef-tbh-test\TestApp\Migrations\20221130083118_AddTaskC.Designer.cs:line 51
at Microsoft.EntityFrameworkCore.Migrations.Migration.<get_TargetModel>g__Create|5_0()
at Microsoft.EntityFrameworkCore.Migrations.Migration.get_TargetModel()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration, MigrationsSqlGenerationOptions options)
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.<>c__DisplayClass16_2.<GetMigrationCommandLists>b__2()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Table name must be specified to configure a table-specific property mapping.
editim
changed the title
EF 7.0.0 TBH migration fails with System.InvalidOperationException
EF 7.0.0 TPH migration fails with System.InvalidOperationException
Nov 30, 2022
Why is migration failing?
Hi.
Had existing project on .net6/ef6.
Upgraded project to .net7/ef7.
Added new task type with migration and newly generated migration is failing.
See, example repo.
Any ideas how to fix this?
Thanks
Code
Repo with the issue example https://github.com/editim/dotnet-ef-tbh-test
Error
Include provider and version information
EF Core version: 6.0.0
Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (e.g. .NET 6.0)
Operating system:
IDE: (e.g. Visual Studio 2022 17.4)
EF Core version: 7.0.0
Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer)
Target framework: (e.g. .NET 7.0)
Operating system:
IDE: (e.g. Visual Studio 2022 17.4)
The text was updated successfully, but these errors were encountered: