stuck in EF migration limbo

后端 未结 7 1509
慢半拍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:51

    I got around this by

    • Run "Update-Database -Script -Force"
      • note the last explicit migration attempted before the error "Unable to update database..."
    • Run "Update-Database -Script -TargetMigration [lastmigration]" using the last migration noted from the previous attempt

    I could then run in the script and add a new migration. This is on EF6 and Nuget 2.8 - it may not have worked when the question was posted.

    0 讨论(0)
提交回复
热议问题