EFCore + MySql codeFirst 迁移 Migration出现的问题

 

第二次使用Migration update-database的时候出现以下错误:

System.NotImplementedException: The method or operation is not implemented. at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(RenameColumnOperation operation, IModel model, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder) at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)

后来发现是

MySql.Data.EntityFrameworkCore 下的问题(应该是没有实现renameColumn的生成sql方法):

改为使用 Pomelo.EntityFrameworkCore.MySql 就完美解决问题

 

posted @ 2019-08-15 23:29  MaxGorGor  阅读(678)  评论(0编辑  收藏  举报