Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reverse engineer on mysql not working (The annotation 'MySql:IndexPrefixLength' cannot be added because an annotation with the same name already exists.) #571

Closed
manuel-zulian opened this issue Nov 11, 2020 · 1 comment

Comments

@manuel-zulian
Copy link

Reverse enginneering a mysql db doesn't work anymore after upgrading to the latest version (2.5), raising this output:

System.Exception: Reverse engineer error: 
System.InvalidOperationException: The annotation 'MySql:IndexPrefixLength' cannot be added because an annotation with the same name already exists.
   at Microsoft.EntityFrameworkCore.Infrastructure.Annotatable.AddAnnotation(String name, Annotation annotation)
   at Microsoft.EntityFrameworkCore.Infrastructure.Annotatable.AddAnnotation(String name, Object value)
   at Microsoft.EntityFrameworkCore.Infrastructure.Annotatable.Microsoft.EntityFrameworkCore.Metadata.IMutableAnnotatable.AddAnnotation(String name, Object value)
   at Microsoft.EntityFrameworkCore.MutableAnnotatableExtensions.AddAnnotations(IMutableAnnotatable annotatable, IEnumerable`1 annotations)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.VisitIndex(EntityTypeBuilder builder, DatabaseIndex index)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.VisitIndexes(EntityTypeBuilder builder, ICollection`1 indexes)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.VisitTable(ModelBuilder modelBuilder, DatabaseTable table)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.VisitTables(ModelBuilder modelBuilder, ICollection`1 tables)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.VisitDatabaseModel(ModelBuilder modelBuilder, DatabaseModel databaseModel)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.RelationalScaffoldingModelFactory.Create(DatabaseModel databaseModel, Boolean useDatabaseNames)
   at Microsoft.EntityFrameworkCore.Scaffolding.Internal.ReverseEngineerScaffolder.ScaffoldModel(String connectionString, DatabaseModelFactoryOptions databaseOptions, ModelReverseEngineerOptions modelOptions, ModelCodeGenerationOptions codeOptions)
   at ReverseEngineer20.ReverseEngineer.ReverseEngineerRunner.GenerateFiles(ReverseEngineerCommandOptions reverseEngineerOptions) in C:\Code\EFCorePowerTools\src\GUI\RevEng.Core\ReverseEngineerRunner.cs:line 114
   at efreveng.Program.Main(String[] args) in C:\Code\EFCorePowerTools\src\GUI\efreveng\Program.cs:line 68

   at EFCorePowerTools.Handlers.ReverseEngineer.ResultDeserializer.BuildResult(String output) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineer\ResultDeserializer.cs:line 27
   at ReverseEngineer20.ReverseEngineer.EfRevEngLauncher.GetOutput() in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineer\EfRevEngLauncher.cs:line 112
   at ReverseEngineer20.ReverseEngineer.EfRevEngLauncher.LaunchExternalRunner(ReverseEngineerOptions options, Boolean useEFCore5) in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineer\EfRevEngLauncher.cs:line 51
   at EFCorePowerTools.Handlers.ReverseEngineerHandler.<ReverseEngineerCodeFirstAsync>d__3.MoveNext() in C:\projects\efcorepowertools\src\GUI\EFCorePowerTools\Handlers\ReverseEngineerHandler.cs:line 264

It seems to be a problem in the pomelo lilbrary (PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1189), but it seems ef power tools does not include the fix (yet).

Steps to reproduce

Check PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1189

Further technical details

EF Core Power Tools version: (found in About dialog - blue questionmark icon on context menu)
2.5.277.0

Database engine: (SQlite, SQL Compact, SQL Server, Postgres)
MySql

Visual Studio version: (e.g. Visual Studio 2017 15.7)
16.8

@ErikEJ ErikEJ closed this as completed in 13765b8 Nov 11, 2020
@ErikEJ
Copy link
Owner

ErikEJ commented Nov 11, 2020

Fixed in latest daily build (.279 or later)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants