Skip to content

EfSchemaCompare limitations

Jon P Smith edited this page Jun 4, 2019 · 6 revisions

There are a few limitations on what the EfSchemaCompare feature can check.

Checks that the system can't do

  1. Because I use EF Core's scaffolder I cannot check if an index is applied to a foreign key (the scaffolder assumes EF Core will do that by default). EF Core adds indexes to foreign keys.

Checks that don't always work properly

  1. There are some limitations around setting default values (EF Core fluent command .HasDefaultValue("...")).
    • The format of string, DataTime, Enums, and bool in the database are different to the C# version, and for some the format also changes between database servers. You might want to suppress this test using AddIgnoreCompareLog - see this example.
    • If you set a default value that is the default for that class, then EF Core doesn't report that which results in ValueGenerated errors.
  2. The format of a computed column (EF Core fluent command .HasComputedColumnSql("...")) may differ to your original, e.g. it will have extra brackets. You can normally fix that by changing your C# side string to be the same as the one in the database.

Checks that my software doesn't currently do

  1. I have not included code to find/check sequences.

DbQuery cannot be checked

I cannot (currently) check DbQuery types. I output one warning with all the DbQuery types in so that you know that haven't been checked. You need to ignoreTheseErrors to ignore the error.

Clone this wiki locally