stuck in EF migration limbo

后端 未结 7 1512
慢半拍i
慢半拍i 2020-12-20 10:58

i have somehow gotten my EF5 project into a state where I can\'t proceed.

When I do an \'update-database\' i get:

Unable to update database to

7条回答
  •  無奈伤痛
    2020-12-20 11:37

    This can happen when you are trying to merge with migration which has the same base as your migration because of which there is model difference in one of migration schema even though that table exists

    To solve this problem what you can do is create merge migration by command

    Add-Migration -IgnoreChanges

    followed by migration name

    This creates an empty migration with the current model as a snapshot. Thus this will solve your model difference problem and your tables and models will be in sync

提交回复
热议问题