📎 AI Summary:
The thread discusses an issue encountered when changing the 'Rating' column from an int to a double in an Entity Framework database, which results in an error due to existing dependencies, such as default constraints or statistical objects. The original poster seeks clarification on why this problem occurs. A respondent suggests that objects depending on the column, like auto-created system stats, may prevent the schema change.

mishrajicoder

New Member
Member details
Joined
Oct 17, 2022
Messages
6
Thread Author #1
In essence, I obtained a table in my EF database with the following properties:
Code:
public int Id { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string Image { get; set; }
public string WatchUrl { get; set; }
public int Year { get; set; }
public string Source { get; set; }
public int Duration { get; set; }
public int Rating { get; set; }
public virtual ICollection<Category> Categories { get; set; }
When I convert the int of Rating to a double, I receive the following issue when updating the database:
Column 'Rating' is required by the object 'DF Movies Rating 48CFD27E'. ALTER TABLE ALTER COLUMN Rating failed because this column is used by one or more objects.
What exactly is the problem?
 

Neemobeer

Windows Forum Team
Staff member
Member details
Joined
Jul 4, 2015
Messages
8,995
There are objects that rely on that column. Likely auto created stats objects in sys
 

Solution