How to Enable Migration to update my database in MVC4?

前端 未结 4 1482
时光取名叫无心
时光取名叫无心 2021-01-01 15:03

I\'m working on a project using MVC4 in Visual Studio 2012 and have added a column in the table.

Now when I want to debug my project the error says to use the migrat

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-01 15:14

    Commands:

    1. enable-migrations default context
    2. add-migration InitialCreate (for generating snapshot)
    3. add-migration InitialCreate (to apply snapshot)
    4. update-database
    5. update-database -verbose

    Detailed explination will here: http://www.dotnet-tricks.com/Tutorial/entityframework/R54K181213-Understanding-Entity-Framework-Code-First-Migrations.html

提交回复
热议问题