Closed amyboose closed 10 months ago
I'm experiencing the same issue with version 8.0.0-rc.2.
Finally got around to looking into this - the root cause seems to be https://github.com/dotnet/efcore/issues/27973. The index in question is defined on the TPC root in the model, and "applied" for each TPC child. Now, in regular mode (without this plugin), RelationalIndexExtensions.GetDatabaseName(StoreObjectIdentifier)
knows how to calculate the correct index name - different for each TPC child; but in this plugin, we need to be able to set a different (rewritten) name for each TPC child, but that's not supported. /cc @AndriySvyryd
In the meantime, I'll make sure to at least clear the index name, which should remove the exception - but leave the index name without rewritten.
Opened #245 to track actually rewriting the index names on the children - refraining from rewriting for now.
My code:
I've got an successful migration without using SnakeCaseNamingConvention. But using convention I've got an exception:
A migration using SnakeCaseNamingConvention:
The migration creates 2 indexes with the same name: ix_campaign_products_product_id
For example, indexes without SnakeCaseNamingConvention:
The last example show that names contains full class name.
Microsoft documentation writes:
Provider and version information
EF Core version: 7.0.2 Database provider: Npgsql Entity Framework Core provider for PostgreSQL 7.0.1 Target framework: NET 7.0 Operating system: Windows 10 IDE: Visual Studio 2022 17.4