Bug #71673 DropProcedureOperation and AlterProcedureOperation are not implemented
Submitted: 11 Feb 2014 20:58 Modified: 21 Feb 2014 16:01
Reporter: Gabriel Bartolazzi Email Updates:
Status: Analyzing Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:6.8.3 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[11 Feb 2014 20:58] Gabriel Bartolazzi
Description:
DropProcedureOperation and AlterProcedureOperation are not implemented in MySqlMigrationSqlGenerator.
When MapToStoredProcedures is used and you want to make an upgrade can throw an exception.

How to repeat:
1- Create a simple context and generate the database using Enable-Migrations.

2- Modify the file Migrations/Configuration.cs
        public Configuration()
        {
            AutomaticMigrationsEnabled = true;
        }

3- Add MapToStoredProcedures to an entity
For example:
 protected override void OnModelCreating(DbModelBuilder modelBuilder)
  {
   base.OnModelCreating(modelBuilder);
   modelBuilder.Entity<Car>().MapToStoredProcedures();
  }

4- Execute Update-Database
5- Add a new property to the entity.
6- Execute Update-Database again

Suggested fix:
Add DropProcedureOperation and AlterProcedureOperation in MySqlMigrationSqlGenerator.

#if EF6
      _dispatcher.Add("HistoryOperation", (OpDispatcher)((op) => { return Generate(op as HistoryOperation); }));
      _dispatcher.Add("CreateProcedureOperation", (OpDispatcher)((op) => { return Generate(op as CreateProcedureOperation); }));
      _dispatcher.Add("UpdateDatabaseOperation", (OpDispatcher)((op) => { return Generate(op as UpdateDatabaseOperation); }));
#endif