-
Notifications
You must be signed in to change notification settings - Fork 57
EfSchemaCompare limitations
Jon P Smith edited this page Jan 26, 2021
·
6 revisions
There are a few limitations on what the EfSchemaCompare feature can check.
- 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.
- 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.
- I don't check Views or keyless entity classes
- I don't check Alternative keys.
- I have not included code to find/check sequences.
- Testing against a PostgreSQL db
- Changes in EfCore.TestSupport 5
- Testing with production data
- Using an in-memory database (old)