How can I disable code first migrations

后端 未结 5 1645
醉话见心
醉话见心 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:36

    If you already used Migrations then changing only Initializer won't help. You need to go to Management Studio, open your database tables, go to System Tables folder and remove __MigrationHistory table that is located there (for EF6 and above, it's located directly under Tables). This will disable Migrations for good.

提交回复
热议问题