Skip to content

HasCheckConstraint does not work with columns starting with uppercase #1727

@rajmondburgaj

Description

@rajmondburgaj

I am trying to run a migration where I use HasCheckConstraint method on one entity. For some reason it complains like the column is not there, but the column is present in the entity. I think somehow the column name is changed to lowercase and maybe is not able to find it the table, therefore throwing.

modelBuilder.Entity<FeatureDbEntity>(entity =>
{
      ...
      entity.HasKey(x => x.Id);
      entity.HasCheckConstraint("CK_Features_Version", "Version > 0");
      ....
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions