jason
jason

Reputation: 7164

Database changed by hand on EF Code First

I have a database which is generated by EF code first. My coworker added a column to this database by hand (not by using EF migrations). Then I added the column name to my entity to make it synchronized. Now I remove another column using EF Code first migration. Would anything bad happen when I use update-database? Thanks.

Upvotes: 0

Views: 103

Answers (1)

Vishal Gadhiya
Vishal Gadhiya

Reputation: 46

Try it. I think that is worked.

  1. Remove properties from the model.
  2. Run 'Enable-Migrations' in package manage console.
  3. Next Run 'Add-Migration "MigrationsName"'. if any case it is showing 'The project tesproject failed to build then build project again.
  4. Now run 'Update-Database'

Upvotes: 1

Related Questions