Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update-database - column does not exist

When I tried to use update-database -verbose -force, I get an error:

ALTER TABLE DROP COLUMN failed because column 'countReferralsRegistrations' does not exist in table 'UserProfile'.

The problem is - I don't have (and I don't want to have) this column in model and also in table UserProfile.

How can I resolve it?

like image 316
whoah Avatar asked Sep 29 '26 09:09

whoah


1 Answers

SOLUTION

use first: Add-Migration InitialMigrations -IgnoreChanges and then update-database verbose. This will work

like image 191
whoah Avatar answered Oct 01 '26 05:10

whoah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!