1

Whilst trying to add migration the error shows up:

Unable to generate an explicit migration because the following explicit migrations are pending: 
[202105121227574_InitialModel, 202105130939495_AddIsSubscribedToCustomer, 
202105130949458_AddMembershipType, 202105130952550_PopulateMembershipTypes, 
202105131009495_ApplyAnnotationsToCustomerName, 202105131435142_AddNameToMembershipType,  
02105131435496_UpdateExistingMembership, 202105131443052_UpdateExistingMembership2,...

Which doesn't make much sense as long time ago I've added them and updated database after each one. So I tried to update-database, but as one might suspect the error "There is already an object named 'ColumnName' in the database." shows up.

J. Doe
  • 49
  • 4
  • Hi, could you please add the error message inside a quotation brackets, for a better reading experience. Thank you :) – Ashraf Alshahawy May 28 '21 at 17:12
  • Does this answer your question? [Unable to generate an explicit migration in entity framework](https://stackoverflow.com/questions/9817860/unable-to-generate-an-explicit-migration-in-entity-framework) – Maarten Derickx May 28 '21 at 19:24

1 Answers1

0

As M.D. pointed out, the answer is probably here in Unable to generate an explicit migration in entity framework.

However if this option is option is available to you. drop the db, delete the migration folder and then re-run Add-Migration & Update-database on your package manager console

You can also try run Update-database to apply pending changes.