You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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.
The text was updated successfully, but these errors were encountered: