Mid
From PDF
EF Core
Entity Framework Core
How do you rollback or revert a migration?
Short answer: To remove the last migration before applying it: dotnet ef migrations remove To rollback the database to a previous migration: dotnet ef database update MigrationName To rollback all migrations: dotnet ef database update 0
Real-world example (ShopNest)
When ShopNest adds a DiscountCode column, you create a migration, review the SQL, then apply it on staging before production.
Say this in the interview
- Define — one clear sentence (the short answer above).
- Example — relate it to a project like ShopNest or your real work.
- Trade-off — when you would not use it.
Share this Q&A
Share preview image: https://www.toolliyo.com/images/toolliyo-logo.png