Search code examples
entity-framework-6vagrantentity-framework-migrations

Entity Framework add-migration when using Vagrant


I'm using vagrant to host my DB and website, but I make changes to my project locally and push changes to the vagrant site. I can run migrate.exe to update the DB but I can't figure out how to run add-migration? If I run it locally, it says I have pending changes because I have no DB locally? Can anyone point me in the right direction?


Solution

  • One option to update database without use dotnet ef database update is execute the command bellow in some default action or startup routine

    _dbContext.Database.Migrate();