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

Exception creating migration to Drop a table #27418

Closed
Clive321A opened this issue Feb 9, 2022 · 3 comments
Closed

Exception creating migration to Drop a table #27418

Clive321A opened this issue Feb 9, 2022 · 3 comments

Comments

@Clive321A
Copy link

Hi, im getting an Exception when trying to generate a migration to drop a table

.net 6
EF Core 6.0.1
Pomelo 6.0.1

I removed a Model entity (ApplicantProduct) from the DbContext , and removed any references to it from the codebase.

when I run

add-migration dropTableApplicantProduct -context DatabaseUnitOfWork
I get a stack trace
System.ArgumentException: An item with the same key has already been added. Key: [0, Property: iUW.Models.ApplicantProduct (Dictionary<string, object>).ProductId (no field, int) Indexer Required FK Index]

I initially logged this with MySQL Pomelo, however this has been found to be an issue in EF Core itself

See this issue for full details and stack trace, with reproducible code sample.

PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1613

@smitpatel
Copy link
Contributor

Possible duplicate of #26405

@AndriySvyryd
Copy link
Member

Try 6.0.2

@Clive321A
Copy link
Author

Thanks, confirmed 6.0.2 fixed the issue

@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants