A
A
AspMaster2019-03-22 18:50:15
ASP.NET
AspMaster, 2019-03-22 18:50:15

How to get rid of Entity Framework Core migration error?

There was such problem - it is necessary to automate database migration. For this I use standard commands:

dotnet ef migrations add
dotnet ef update

I constantly encounter an error that looks like:
В базе данных уже существует объект с именем XXX
I know the solution to this problem - we go into the migration file, delete the contents of the Up method and everything works. But since I want to automate this process, unfortunately I can't do it. How can I do it in such a way that either somehow avoid this error, or generate a migration file immediately with an empty Up method?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question