How to add a new code-first migration with a newly-generated database?

前端 未结 3 2168
花落未央
花落未央 2021-02-11 05:09

I\'ve enabled code-first migrations on my entity framework project, and have added several migrations which do things like rename tables. However, I have now deleted the databa

3条回答
  •  情深已故
    2021-02-11 05:47

    Go to MigrationHistory table in sql server (under system folder) it has row for your migration and db hash in it which must be the same with one in your migration file, just copy it from db to file.

    In other words you need to sync your MigrationHistory table with actual migrations.

提交回复
热议问题