EfSchemaCompare limitations - JonPSmith/EfCore.TestSupport GitHub Wiki
There are a few limitations on what the EfSchemaCompare feature can check.
Checks that the system can't do
- 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
- There is a bug in the EF Core 3 version around the nullability of properties in Owned Types.
- There are some limitations around setting default values (EF Core fluent command
.HasDefaultValue("...")
).- The format of
string
,DataTime
,Enums
, andbool
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 usingAddIgnoreCompareLog
- see this example of how to tell EfSchemaCompare to ignore Default values. - 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.
- The format of
- 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
- I don't check Views or keyless entity classes
- I don't check Alternative keys.
- I have not included code to find/check sequences.