Bug #83288 Missing function in MySQL.Data.EntityFrameworkCore
Submitted: 6 Oct 2016 14:13 Modified: 12 Oct 2016 14:26
Reporter: Jeff Bromberger Email Updates:
Status: Duplicate Impact on me:
Category:Connector / NET Severity:S2 (Serious)
Version:7.0.5-IR21 OS:Microsoft Windows
Assigned to: CPU Architecture:Any

[6 Oct 2016 14:13] Jeff Bromberger
This bug is very similar to 82981.  There are a number of scripts that are used to produce migrations when using entity framework.  The command Script-Migration is used to produce an SQL script to update the database.  This command fails with the following stack trace:

PM> Script-Migration
System.NotImplementedException: The method or operation is not implemented.    at MySQL.Data.EntityFrameworkCore.Migrations.Internal.MySQLHistoryRepository.GetCreateIfNotExistsScript()
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateScript(String fromMigration, String toMigration, Boolean idempotent)
   at Microsoft.EntityFrameworkCore.Design.MigrationsOperations.ScriptMigration(String fromMigration, String toMigration, Boolean idempotent, String contextType)
   at Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsScriptCommand.Execute(CommonOptions commonOptions, String from, String to, String output, Boolean idempotent, String context, String environment)
   at Microsoft.EntityFrameworkCore.Tools.Cli.MigrationsScriptCommand.<>c__DisplayClass0_0.<Configure>b__0()
   at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
   at Microsoft.EntityFrameworkCore.Tools.Cli.Program.Main(String[] args)
The method or operation is not implemented.

How to repeat:
Go into the nuget package manager console of any project which uses entity framework core and the MySQL connector.  Simply run Script-Migration to produce the error.  Again, this is very similar to bug 82981 except that in that case a different unimplemented function is exposed by running the Update-Database script.

Suggested fix:
Implement the missing functionality to allow the workflow
[12 Oct 2016 7:00] Chiranjeevi Battula
Hello Jeff Bromberger,

Thank you for the bug report.
This is most likely duplicate of Bug #83210, please see Bug #83210.

[12 Oct 2016 14:26] Jeff Bromberger
As part of the EF workflow, anytime a model is added or changed you must run the script which generates the migrations to modify the database itself.  These functions are what is missing from the MySQL package.  Bug 83210 may be hitting the same issue behind the scenes, but it doesn't even mention the step of generating a migration.  Therefore I think that this bug and 82981 are more descriptive of the actual issues (missing functions that need to be implemented to allow the migration generation to work).