How to downgrade Entity framework from 6 to 5?

前端 未结 5 1646
终归单人心
终归单人心 2020-12-28 14:08

I\'m creating a Asp.Net MVC project using VS2013 and added hottowel (2.0.1) using nuget. However, the breeze doesn\'t work with Entity Framework 6.

How to downgrade

5条回答
  •  礼貌的吻别
    2020-12-28 14:22

    Entity Framework also moves the __MigrationHistory table from System Tables to user tables. When I tried to run my application after rollback it wouldn't work, so I had to move the __MigrationHistory back to the system tables with:

    EXEC sys.sp_MS_marksystemobject __MigrationHistory;
    

    When I did upgrade to EntityFramework 6 I had to add an empty migration (unfortunately I do not remember the reason, but I guess it complained about updating the database or similar). I also had to remove that empty migration. Since this was a completely empty migration I guess this is safe to do, I do not know about migrations that actually change the database. However, they might not complain when running the program.

    delete from dbo.__MigrationHistory where MigrationId = 'myEmptyMigration';
    

    Then I deleted the empty migrationfile from my project which resolved my problems.

提交回复
热议问题