Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad intersection table generation when M:M tables have the same primary key name #64

Closed
Olivercomputing opened this issue Jun 11, 2023 · 1 comment
Labels
bug Something isn't working released Issue is resolved in a current release
Milestone

Comments

@Olivercomputing
Copy link

I like to use "id" as the primary key for all tables. I found out that an incorrect intersection table is being automatically generated for an M:M relationship between two tables both having "id" as the PK. A one column - "id" - table is generated, evidently because the intersection table is simply copying the primary key names from both tables and treating them as the same. Giving different PK names causes the (apparently) correct insection table to be created. However, this feels like an ugly hack. Ideally the code generation should create new column names in the intersection table.

One convention that could work is to simply append the table name to the column names with a simple delimiter (e.g. id_TABLE1 and id_TABLE2) , ensuring no name conflict and making it easy to parse apart if needed.

I'm not sure if this is an EFDesigner issue or an EF Core issue.

@msawczyn msawczyn added the investigating Looking into this label Jun 22, 2023
@msawczyn msawczyn added bug Something isn't working and removed investigating Looking into this labels Jun 26, 2023
@msawczyn msawczyn added this to the 4.2.5 milestone Jun 26, 2023
@msawczyn
Copy link
Owner

This is a regression. It's been reverted to the old behavior, and a fix will go out in v 4.2.5.

@msawczyn msawczyn added the pending release Issue is resolved in the current codebase, will be published with the next release label Jun 27, 2023
@msawczyn msawczyn added released Issue is resolved in a current release and removed pending release Issue is resolved in the current codebase, will be published with the next release labels Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released Issue is resolved in a current release
Projects
None yet
Development

No branches or pull requests

2 participants