How can I disable code first migrations

后端 未结 5 1639
醉话见心
醉话见心 2020-11-30 23:05

I have a code-first entity model in EF5. But I want to manage the database changes manually -- I do not want EF to modify my existing database and all its data. But when I m

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-30 23:38

    I just resolved this "issue" by

    1. Deleting table "_MigrationHistory" from the database.
    2. Deleting "Migrations" folder form the project.
    3. Updating EDMX file.
    4. Clean project & rebuild it.

    The config of my environment is following

    1. Visual Studio 2017 15.8.2
    2. ASP NET MVC project
    3. .NET Framework 4.6.1
    4. Entity Framework 6.2.0
    

提交回复
热议问题