This is all related to SQL Server.
Visual Studio 2019 Database Schema Compare ignores foreign key names (definition of the keys is the same) when comparing schema between Database Project (source) and actual database (destination). It is not just the casing, foreign key names are completely different yet no differences detected.
I went through all Schema Compare options available and didn't find anything to not ignore differences in foreign key names.
Is that just the way it is? Or did I miss some options?
Several last versions of SSDT ignore names of system-named constraints, and AFAIK it's not configurable. Suppose your database project has a table definition that looks like this:
As you can see, this table has 2 unnamed constraints (PK and a default on the
IsActive
column), and a unique key with its name specified explicitly. Now, if you look into metadata, for keys it would bethey all have names of course, but some will be automatically named by SQL Server during table / constraint creation, such as:
Note the
is_system_named
column, it tells SSDT which constraints' names should be ignored by Schema Compare. If you set explicit names for either PK or the default, these differences will be highlighted during comparison. If, however, a constraint is unnamed in the project and hasis_system_named = 1
in the database, its auto-generated name will be ignored.