Answer the question
In order to leave comments, you need to log in
Database migration, how to implement it?
I work with mvc, I connected the database in the console, I wrote:
cd "path"
dotnet ef migration add "name"
dotnet ef database update "name" the database
was created according to my model, then I want to add new fields and how can I update the database ??? I understand that you need to delete old migrations and databases and do everything again?
Answer the question
In order to leave comments, you need to log in
You don't need to delete anything.
1. make changes to the EF models
2. dotnet ef migration add "name2"
3. dotnet ef database update
The third command will roll up all the migrations that have not yet been applied.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question