efcore / EFCore.NamingConventions

Entity Framework Core plugin to apply naming conventions to table and column names (e.g. snake_case)
Apache License 2.0
716 stars 73 forks source link

fix "Regression in 7.0.2: TPH table names are not being rewritten" fix #184 #199

Closed erwan-joly closed 8 months ago

erwan-joly commented 1 year ago

fix "Regression in 7.0.2: TPH table names are not being rewritten" fix #184

erwan-joly commented 1 year ago

A bit convoluted but it works. Unfortunately we can't know if we are in a TPH context in the ProcessEntityTypeAdded. We finally know about it when we are looking at child in ProcessEntityTypeBaseTypeChanged in that case we run the code we used to have before the regression (rename the abstract class).

erwan-joly commented 1 year ago

@roji let me know if that's a good enough fix

roji commented 8 months ago

@erwan-joly thanks for your patience, I'm finally sitting down and going through the EFCore.NamingConventions issues.

I took a deeper look at things, and decided to go in a slightly different direction - see #239 for what I've done. This new logic is hopefully more robust, simpler to follow and also aligns better with EF's own policy on when the table name annotation is set.

I'll probably release 8.0.0 very soon with this change (it has been long enough), but I very much welcome any review comments on what I've done - if there's an issue I'd be happy to make a 8.0.1 fix etc.

Thanks again for working on this!