I have multiple schemas with tables that share the same primary key name, which PostgreSQL allows.
For example:
- table a on schema b will get a PK name of PK_a
- table a on schema c will get the same PK name
This works fine up to .NET 8/9.
After upgrading to EF Core 10, migrations try to drop and recreate these PKs, breaking foreign key constraints.
Instead of enforcing uniqueness across all tables, it would be great if SharedTableConvention also considered the schema.
As @roji said in this comment on issue 3639:
PK constraint names are scoped to their schema - it's OK to have the same constraint name for two tables, just as long as they're not within the schema.
Attached minimal repro (code started with .NET 8 and upgraded to 10 - showing the bad migration):
repro.zip