How EfSchemaCompare works
masterEfSchemaCompare validates that your EF Core Model (the schema defined in your code) is in sync with the actual database schema. It uses two stages of verification:
Stage 1 (EF Core vs Database): Checks if the EF Core
DbContextmatches the database. It verifies:- Tables/Views: Existence, name, and schema.
- Properties/Columns: Existence, data type (size/precision), nullability, computed column settings, and default values.
- Primary Keys: Constraint names and properties.
- Foreign Keys: Constraint names, delete behavior, and properties.
- Indexes: Constraint names, uniqueness, and properties.
Stage 2 (Database Unused Items): Checks the database for items that are not mapped in your EF Core model, specifically:
- Unused tables or views
- Unused columns
- Unused indexes