前段时间,遇到的是ef core mysql迁移的时候,bool类型会自动yingsheweishort的问题,需要手动更正一下
今天测试的时候,遇到了MySQL数据表修改后迁移的问题。
问题详情如下
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.UpdateDatabase.<>c__DisplayClass0_1.<.ctor>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
The method or operation is not implemented.
然后一顿搜索,发现当前的mysql修改迁移确实有BUG,但是新增表和新增字段是没有问题的。
所有,修改属性的时候,只能是将表重建才可以
或者更换polem的那个包可以实现迁移
https://bugs.mysql.com/bug.php?id=82981https://*.com/questions/47952803/net-core-2-0-database-first-approach-scaffold-dbcontext-of-mysql-db