dotnet / dotnet/efcore

Add-Migration does not align snapshot and migration file locations

Open
#28,316 9 comments 0 reactions 0 assignees View on GitHub
area-migrations customer-reported
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

I changed my model, and I wanted to start my migrations over again from scratch instead of adding a new migration.
I deleted the existing migration file and the corresponding .Designer.cs file.
I am using Sqlite and choose the file location dynamically, so there is no database copy maintained and no history migrations table to delete. I did delete the old database anyway.

I ran Add-Migration and it somehow created a .Designer.cs file that referred to the old model, and the new migration file was the difference from that to the current model.

I am at a loss for how EF could even do that given I deleted the old .Designer and migration files. Doing a Clean Solution, restarting VS, and checking in the project after deleting the old migration did not make any difference.

How can I clear out whatever cache it is that Add-Migration is using?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.