I make a mistake. I delete some row in table __MigrationHistory
in my database.
and now when I run my project I force this error:
ALTER TABLE DROP COLUMN failed because column 'xxx' does not exist in table 'yyy'.
How can I solved this problem?
Add a new migration to re-synchronize:
add-migration MissingXXX -IgnoreChanges // tells EF to just take a snapshot
update-database
Now you are back in sync and can continue with future model changes.
OK, finally I solved my problem.
I added field 'xxx' to table 'yyy' manually in my database.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With