Bug #82981 Missing implementation for running EntityFramework Core code first migration
Submitted: 14 Sep 2016 7:41 Modified: 20 Mar 2020 21:07
Reporter: Renaud Calmont Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:7.0.5-ir21 OS:Any
Assigned to: CPU Architecture:Any
Tags: EF, migration

[14 Sep 2016 7:41] Renaud Calmont
Description:
System.NotImplementedException: The method or operation is not implemented.
   at MySQL.Data.EntityFrameworkCore.Migrations.Internal.MySQLHistoryRepository.get_ExistsSql()
   at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.Design.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Tools.Cli.DatabaseUpdateCommand.<>c__DisplayClass0_0.<Configure>b__0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)

How to repeat:
Create a .NET Core project with these dependencies :
- Mysql.Data.Entityframeworkcore adapter 7.0.5-ir21
- Microsoft.EntityFrameworkCore.Tools 1.0.0-preview2-final
- Microsoft.EntityFrameworkCore.Design 1.0.0-preview2-final

Add all needed EF classes, a context with a model, then create a migration from the command line:
$ dotnet ef migrations add dummy_initial

And try to apply it:
$ dotnet ef database update

I can provide a minimal project to reproduce.

Suggested fix:
Please keep going on!
[14 Sep 2016 15:12] Chiranjeevi Battula
Hello Renaud Calmont,

Thank you for the bug report.
Could you please provide repeatable test case (sample project, model etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[14 Sep 2016 15:46] Renaud Calmont
mini project for reproduction

Attachment: Sandbox.zip (application/zip, text), 101.47 KiB.

[14 Sep 2016 15:52] Renaud Calmont
I just uploaded a sandbox project to reproduce. Sorry for overcomplication, I quickly hacked it out a bigger projet.
You should only change the hardcoded connection string in the DbContextFactoryForCli.cs to call your own server.
Then run the last command from the issue description:
$ dotnet ef database update
[27 Sep 2016 8:06] Chiranjeevi Battula
Hello Renaud Calmont,

Thank you for the bug feedback.
I could not open the project, can you please provide us proper test case (database, model/screenshot etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[27 Sep 2016 14:40] Gabriela Martinez Sanchez
Hi,
Not needed to add more information. We have confirmed and were able to reproduce this issue. A fix will be added in the next release of 7.0.x
Thank you.
[20 Mar 2020 21:07] Daniel Valdez
Posted by developer:
 
This feature is available in the latest release of Connector NET, v8.0.19.