EF Data migrations won't detect changes when adding new migration

后端 未结 16 1940
情话喂你
情话喂你 2020-12-09 14:53

I am using Entity Framework 5.0 Data migrations along with code first. When i add a new field to my model and execute the following command in the package manager console.

16条回答
  •  被撕碎了的回忆
    2020-12-09 15:21

    I had to delete the _MigrationHistory table that is generated by EF. Then I ran add-migration again. Be careful with this though, as it will generate the queries needed from scratch, including tables that are already there.

提交回复
热议问题