Answer the question
In order to leave comments, you need to log in
How do you name the link tables?
I think everyone understands the importance of systematization: project, code, names, etc.
Delving into one someone else's project, I thought that it was bad that the many-to-many relationship tables were not named somehow in a special way, so that it was immediately clear that this was a relationship table.
Do you name the link tables somehow in a special way?
For example, there are tables:
accounts
awards
It would be possible to make a table of links between accounts with awards:
link_account_to_awards
But it turns out to be too long. Maybe someone has a better solution? It's just that account_to_awards looks pretty impressive too, but with link_ in front, such tables will all be in one place, in the list of tables (this is especially useful when there are 100+ tables)
Answer the question
In order to leave comments, you need to log in
I used to do it depending on the association (n:m, *:n, 1:n, etc.)
In your case, as I understand it, a specific account has "n" awards, then - AccountToAwards. If "different" accounts are attached to the table of specific awards, then I would call AwardToAccounts
I usually name fk (foreign key), main table and "linked" one:fk_account_awards
Without hesitation, I looked at the CMS Joomla!
Here's how they do it: user_usergroup_map
(mapping the user into groups and vice versa)
accounts
awards
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question