envio
envio

Reputation: 1365

Relocating Entity Framework Migrations Folder

My MVC5 project started off as a single project in the solution. The migrations worked fine. However, I've since moved my domain, services and data components into their own projects. My DbContext is now in the Data project. My migrations folder is still located in the original Web project (I'm guessing I should move this to the Data project). I've changed one of the properties on one of the domain objects (in the Domain project), but now when I run the site or try 'add-migration', nothing is detected. It's like it hasn't checked the new model structure against the existing database.

Any idea where I could be going wrong?

Thanks

Upvotes: 0

Views: 596

Answers (1)

envio
envio

Reputation: 1365

I finally figured this out. In the Package Manager Console when I was trying to add a new migration, I hadn't selected the correct Default project from the toolbar. Once the dropdown value was changed to match the project I wanted to work against, all the changes were detected.

Upvotes: 1

Related Questions