I've got some data in my EF database. I want to change the foreign key in one of my classes:
[ForeignKey("Collection")]
public int CollectionID { get; set; }
Unfortunately I get this error
Cannot insert the value NULL into column 'CollectionID', table 'WebLanguageTeacher1.dbo.Words'; column does not allow nulls. UPDATE fails.
when I try to add new migration to my database. It's understandable: foregin key can't be null, when I create new column in my db, Entity Framework creates new NULL cells.
The question is: what should I do to bypass it? How can I add new Foreign key despite that?