I have created a table with column like this
builder.Property(b => b.IndicatorPriority)
.HasColumnName("IndicatorPriority") //Optional, Priority
.HasColumnType("INT")
.IsRequired();
I did not specify any default value for this column but the migration generated using add-migration this, has default value
migrationBuilder.AddColumn<int>(
name: "IndicatorPriority",
schema: "Internal",
table: "IndicatorStrategyMapping",
type: "INT",
nullable: false,
defaultValue: 0);
How can I remove this default value binding in code first?
I tried adding these lines in my column definition
.HasDefaultValue(null)
and
.HasDefaultValueSql(null)
but no migration change is detected by these lines.
How can I delete the default value link for non nullable columns?
Update
As asked in one comment, so to clarify, I do want a non nullable column with no default value to force user supply value for this column while inserting records